diff --git a/.github/workflows/frontend-admin-build.yml b/.github/workflows/frontend-admin-build.yml index 935656b8..3ff9412b 100644 --- a/.github/workflows/frontend-admin-build.yml +++ b/.github/workflows/frontend-admin-build.yml @@ -111,6 +111,8 @@ jobs: - name: Build preview APK working-directory: frontend-admin + env: + EAS_BUILD_NO_EXPO_GO_WARNING: true run: eas build --platform android --profile preview --non-interactive - name: Download preview APK @@ -158,6 +160,8 @@ jobs: - name: Build production APK working-directory: frontend-admin + env: + EAS_BUILD_NO_EXPO_GO_WARNING: true run: eas build --platform android --profile production --non-interactive - name: Download production APK diff --git a/ansible/group_vars/all/vars.yml b/ansible/group_vars/all/vars.yml index 749feede..d840b373 100644 --- a/ansible/group_vars/all/vars.yml +++ b/ansible/group_vars/all/vars.yml @@ -1,47 +1,37 @@ -postgres_version: "16" -postgres_databases: - - name: gestion_db - owner: postgres -postgres_password: "VotreMotDePasseSecure123!" - +pg_version: "16" +db_user: admin_gestion_commande_db +db_name: gestion_commande_db +db_password: "hb-FS462(#I~6(4',Nt=3Rd4567890jsezZ" +db_host: "localhost" +db_port: 5432 # Redis Configuration redis_bind: "127.0.0.1" redis_port: 6379 -redis_maxmemory: "512mb" +redis_maxmemory: "1024mb" redis_maxmemory_policy: "allkeys-lru" -redis_password: "UltrasecretMdp123!" +redis_password: "uQ64h5UhFdrm!H|_cCQer" # ============================================ # Configuration Nginx et Applications # ============================================ -nginx_app_name: "nantais-livraison" -nginx_domain: "{{ ansible_default_ipv4.address }}" + directory: "/home/ubuntu" -tunnel_log: "/var/log/tunnel.log" -tunnel_log_error: "/var/log/tunnel-error.log" -# Chemins des applications (bonnes pratiques) -nginx_frontend_path: "/home/ubuntu/frontend" backend_dir: "/home/ubuntu/backend" backend_binary: "/home/ubuntu/backend/main" -docker_dir: "/home/ubuntu/docker" +uploads_dir: "/home/ubuntu/backend/uploads" frontend_port: 5173 -backend_dir_docker: "/home/ubuntu/backend/docker" +domain_name: "uber-stup.club" # Utilisateurs et permissions user_web: "www-data" # Utilisateur pour les applications web user_deploy: "ubuntu" # Utilisateur pour le déploiement user_owner: "root" # Propriétaire des fichiers systemd -docker_user: docker -docker_group: docker -# Backend -backend_port: 8080 +# Backend +backend_local_port: 8080 +backend_port: 443 # Timeouts nginx_proxy_timeout: 60 -# Cache Duration -nginx_cache_static_duration: "1y" -nginx_cache_media_duration: "1y" - # Upload Size nginx_max_body_size: "10M" diff --git a/ansible/inventory/host.ini b/ansible/inventory/host.ini index 696c6d1a..919cad91 100644 --- a/ansible/inventory/host.ini +++ b/ansible/inventory/host.ini @@ -1,21 +1,5 @@ [all] -vm-postgres ansible_host=192.168.1.65 ansible_user=ubuntu ansible_ssh_pass=root -vm-redis ansible_host=192.168.1.62 ansible_user=ubuntu ansible_ssh_pass=root -vm-nginx ansible_host=192.168.1.67 ansible_user=ubuntu ansible_ssh_pass=root -vm-backend ansible_host=192.168.1.72 ansible_user=ubuntu ansible_ssh_pass=root +uber-stup ansible_host=5.252.20.129 ansible_user=root ansible_ssh_pass=rL9lY6YkcDQmfRuZ3Z -[postgres] -vm-postgres ansible_host=192.168.1.65 ansible_user=ubuntu ansible_ssh_pass=root - -[redis] -vm-redis ansible_host=192.168.1.62 ansible_user=ubuntu ansible_ssh_pass=root - -[nginx] -vm-nginx ansible_host=192.168.1.67 ansible_user=ubuntu ansible_ssh_pass=root - -[backend] -vm-backend ansible_host=192.168.1.72 ansible_user=ubuntu ansible_ssh_pass=root - -[services] -vm-redis ansible_host=192.168.1.62 ansible_user=ubuntu ansible_ssh_pass=root -vm-postgres ansible_host=192.168.1.65 ansible_user=ubuntu ansible_ssh_pass=root +[uber-stup] +uber-stup ansible_host=5.252.20.129 ansible_user=root ansible_ssh_pass=rL9lY6YkcDQmfRuZ3Z diff --git a/ansible/playbook-frontend-backend.yml b/ansible/playbook-backend.yml similarity index 50% rename from ansible/playbook-frontend-backend.yml rename to ansible/playbook-backend.yml index d9d7a9c4..44844f6a 100644 --- a/ansible/playbook-frontend-backend.yml +++ b/ansible/playbook-backend.yml @@ -1,6 +1,6 @@ --- - name: Installation et configuration du frontend et backend - hosts: nginx + hosts: all become: true gather_facts: true @@ -19,6 +19,9 @@ - tar - rsync - acl + - nginx + - certbot + - python3-certbot-nginx state: present update_cache: yes @@ -42,23 +45,8 @@ state: present mode: "0644" - - name: Setup Node.js 20 repository + - name: Check Go versions ansible.builtin.shell: | - curl -fsSL https://deb.nodesource.com/setup_20.x | bash - - args: - executable: /bin/bash - - - name: Install Node.js 20 - ansible.builtin.apt: - name: nodejs - state: present - update_cache: yes - dpkg_options: "force-overwrite" - - - name: Check Node.js, npm and Go versions - ansible.builtin.shell: | - echo "Node: $(node -v)" - echo "npm: $(npm -v)" echo "Go: $(go version)" register: versions_check changed_when: false @@ -80,68 +68,25 @@ group: root mode: "0755" - - name: Ensure /home/ubuntu exists with correct permissions + - name: Créer l'utilisateur de déploiement s'il n'existe pas + ansible.builtin.user: + name: "{{ user_deploy }}" + shell: /bin/bash + create_home: yes + state: present + + - name: Ensure /home/{{ user_deploy }} exists with correct permissions ansible.builtin.file: - path: /home/ubuntu + path: "/home/{{ user_deploy }}" state: directory owner: "{{ user_deploy }}" group: "{{ user_deploy }}" mode: "0755" - - name: Remove old frontend directory if exists - ansible.builtin.file: - path: "{{ nginx_frontend_path }}" - state: absent - - - name: Create frontend directory with deploy user ownership - ansible.builtin.file: - path: "{{ nginx_frontend_path }}" - state: directory - owner: "{{ user_deploy }}" - group: "{{ user_deploy }}" - mode: "0755" - - - name: Synchronize frontend content (excluding node_modules and .git) - ansible.builtin.synchronize: - src: ../frontend/ - dest: "{{ nginx_frontend_path }}/" - rsync_opts: - - "--exclude=node_modules" - - "--exclude=.git" - - "--exclude=dist" - - "--exclude=build" - delete: no - recursive: yes - tags: - - syncro - - - name: Install npm dependencies as deploy user - become_user: "{{ user_deploy }}" - ansible.builtin.shell: | - export PATH=/usr/local/go/bin:$PATH - npm install - npm run build - args: - chdir: "{{ nginx_frontend_path }}" - executable: /bin/bash - - - name: Set ownership to www-data for runtime - ansible.builtin.file: - path: "{{ nginx_frontend_path }}" - owner: "{{ user_web }}" - group: "{{ user_web }}" - mode: "0755" - recurse: yes - # ============================================ # BACKEND # ============================================ - - name: Remove old backend directory if exists - ansible.builtin.file: - path: "{{ backend_dir }}" - state: absent - - name: Create backend directory with deploy user ownership ansible.builtin.file: path: "{{ backend_dir }}" @@ -149,15 +94,22 @@ owner: "{{ user_deploy }}" group: "{{ user_deploy }}" mode: "0755" + tags: backend - - name: Copy backend files - ansible.builtin.copy: - src: "../backendprod/gestion/" + - name: Synchroniser le backend Go + ansible.builtin.synchronize: + src: ../backend/gestion/ dest: "{{ backend_dir }}/" - owner: "{{ user_deploy }}" - group: "{{ user_deploy }}" - mode: preserve - directory_mode: "0755" + rsync_opts: + - "--exclude=.git" + - "--exclude=.gitignore" + - "--exclude=docker-compose.yml" + - "--exclude=.env" + - "--no-owner" + - "--no-group" + delete: yes + recursive: yes + tags: backend - name: Compile backend as deploy user become_user: "{{ user_deploy }}" @@ -168,8 +120,8 @@ args: chdir: "{{ backend_dir }}" executable: /bin/bash - tags: - - compile + tags: backend + - name: Set ownership to www-data for runtime ansible.builtin.file: path: "{{ backend_dir }}" @@ -177,6 +129,7 @@ group: "{{ user_web }}" mode: "0755" recurse: yes + tags: backend - name: Set executable permission on backend binary ansible.builtin.file: @@ -184,6 +137,7 @@ owner: "{{ user_web }}" group: "{{ user_web }}" mode: "0755" + tags: backend # ============================================ # SYSTEMD SERVICES @@ -196,39 +150,156 @@ owner: root group: root mode: "0644" + tags: backend - name: Reload systemd daemon ansible.builtin.systemd: daemon_reload: yes - - - name: Enable and restart frontend service - ansible.builtin.systemd: - name: frontend - enabled: yes - state: restarted + tags: backend - name: Enable and restart backend service ansible.builtin.systemd: name: backend enabled: yes state: restarted + tags: backend - name: Wait for backend to be ready ansible.builtin.wait_for: - port: "{{ backend_port }}" + port: "{{ backend_local_port }}" delay: 2 timeout: 30 + tags: backend - name: Display service status ansible.builtin.shell: | - echo "=== Frontend Service ===" - systemctl status frontend --no-pager || true - echo "" echo "=== Backend Service ===" systemctl status backend --no-pager || true register: service_status changed_when: false + tags: backend - name: Show service status ansible.builtin.debug: msg: "{{ service_status.stdout_lines }}" + + - name: Configuration UFW + ansible.builtin.ufw: + rule: allow + port: "{{ item }}" + proto: tcp + loop: + - "{{ backend_port }}" + - 80 + - 22 + + - name: Activation du firewall + ansible.builtin.ufw: + state: enabled + + - name: Vérifier si un certificat existe déjà + ansible.builtin.stat: + path: "/etc/letsencrypt/live/{{ domain_name }}/fullchain.pem" + register: cert_file + tags: [certbot] + + - name: Déployer la configuration Nginx HTTP + ansible.builtin.template: + src: templates/nginx.conf.j2 + dest: /etc/nginx/sites-available/api + vars: + ssl_enabled: false + tags: [certbot] + + - name: Activation du site Nginx + ansible.builtin.file: + src: /etc/nginx/sites-available/api + dest: /etc/nginx/sites-enabled/api + state: link + force: yes + tags: [certbot] + + - name: Suppression du site par défaut + ansible.builtin.file: + path: /etc/nginx/sites-enabled/default + state: absent + tags: [certbot] + + - name: Test de la configuration Nginx + ansible.builtin.command: nginx -t + changed_when: false + tags: [certbot] + + - name: Redémarrage de Nginx + ansible.builtin.systemd: + name: nginx + state: restarted + enabled: yes + tags: [certbot] + + # ============================================================ + # Certificat SSL Let's Encrypt + # ============================================================ + + - name: Générer le certificat SSL avec Certbot + ansible.builtin.command: > + certbot certonly --nginx + -d {{ domain_name }} + --non-interactive + --agree-tos + --email admin@{{ domain_name }} + when: not cert_file.stat.exists + tags: [certbot] + + # ============================================================ + # Nginx - reconfiguration HTTPS après certificat + # ============================================================ + - name: Vérifier la présence du certificat + ansible.builtin.stat: + path: "/etc/letsencrypt/live/{{ domain_name }}/fullchain.pem" + register: cert_file_after + tags: [nginx] + + - name: Déployer la configuration Nginx HTTPS + ansible.builtin.template: + src: templates/nginx.conf.j2 + dest: /etc/nginx/sites-available/api + vars: + ssl_enabled: true + when: cert_file_after.stat.exists + notify: Restart nginx + tags: [nginx] + + - name: Test de la configuration Nginx finale + ansible.builtin.command: nginx -t + changed_when: false + tags: [nginx] + + - name: Redémarrage de Nginx avec SSL + ansible.builtin.systemd: + name: nginx + state: restarted + when: cert_file_after.stat.exists + tags: [nginx] + + - name: Vérifier le renouvellement automatique + ansible.builtin.command: certbot renew --dry-run + register: certbot_renew + changed_when: false + failed_when: false + tags: [certbot] + + - name: Afficher le statut du renouvellement + ansible.builtin.debug: + msg: "{{ certbot_renew.stdout_lines }}" + tags: [certbot] + + handlers: + - name: Reload systemd + ansible.builtin.systemd: + daemon_reload: yes + + - name: Restart nginx + ansible.builtin.systemd: + name: nginx + state: restarted diff --git a/ansible/playbook-nginx.yml b/ansible/playbook-nginx.yml deleted file mode 100644 index e742cf2e..00000000 --- a/ansible/playbook-nginx.yml +++ /dev/null @@ -1,108 +0,0 @@ ---- -- name: Installation et configuration de Nginx - hosts: nginx - become: true - gather_facts: true - - tasks: - - name: Installer Nginx - ansible.builtin.apt: - name: nginx - state: present - update_cache: yes - - - name: Créer le répertoire frontend - ansible.builtin.file: - path: "{{ nginx_frontend_path }}" - state: directory - owner: www-data - group: www-data - mode: "0755" - - - name: Créer le répertoire de logs - ansible.builtin.file: - path: /var/log/nginx - state: directory - owner: www-data - group: adm - mode: "0755" - - - name: Supprimer la config par défaut - ansible.builtin.file: - path: /etc/nginx/sites-enabled/default - state: absent - - - name: Créer la configuration Nginx - ansible.builtin.template: - src: ./templates/nginx.conf.j2 - dest: /etc/nginx/sites-available/{{ nginx_app_name }} - notify: Recharger Nginx - - - name: Activer la configuration - ansible.builtin.file: - src: /etc/nginx/sites-available/{{ nginx_app_name }} - dest: /etc/nginx/sites-enabled/{{ nginx_app_name }} - state: link - notify: Recharger Nginx - - - name: Configurer Nginx global settings - lineinfile: - path: /etc/nginx/nginx.conf - regexp: "{{ item.regexp }}" - line: "{{ item.line }}" - insertafter: "http {" - loop: - - { - regexp: '^\s*server_tokens', - line: " server_tokens off;", - } - - { - regexp: '^\s*client_max_body_size', - line: " client_max_body_size {{ nginx_max_body_size }};", - } - notify: Recharger Nginx - - - name: Tester la configuration Nginx - command: nginx -t - register: nginx_test - changed_when: false - - - name: Afficher le résultat du test - debug: - var: nginx_test.stderr_lines - - - name: Démarrer Nginx - ansible.builtin.systemd: - name: nginx - state: started - enabled: yes - - - name: Configurer UFW - Autoriser HTTP - ansible.builtin.ufw: - rule: allow - port: "80" - proto: tcp - when: nginx_enable_firewall | default(true) - - - name: Configurer UFW - Bloquer accès direct au backend - ansible.builtin.ufw: - rule: deny - port: "{{ backend_port }}" - proto: tcp - from_ip: any - when: nginx_enable_firewall | default(true) - - - name: Configurer le tunnel - ansible.builtin.template: - src: tunnel.conf.j2 - dest: /etc/tunnel.conf - owner: root - group: root - mode: 0644 - notify: Recharger Nginx - - handlers: - - name: Recharger Nginx - systemd: - name: nginx - state: reloaded diff --git a/ansible/playbook.yml b/ansible/playbook.yml index 55188398..a2795223 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -3,101 +3,180 @@ # PostgreSQL Installation (vm-postgres uniquement) # ============================================ - name: Installation et configuration de PostgreSQL - hosts: postgres + hosts: uber-stup become: true gather_facts: true tasks: - - name: Installer les dépendances système - apt: + # ============================================================ + # Dépendances requises + # ============================================================ + - name: Installer les dépendances pour le dépôt APT + ansible.builtin.apt: name: - - wget - gnupg2 - - lsb-release + - curl - ca-certificates - - apt-transport-https - - acl # Nécessaire pour become_user + - lsb-release + - python3-psycopg2 + - acl state: present update_cache: yes + # ============================================================ + # Ajout du dépôt officiel PostgreSQL + # ============================================================ - name: Ajouter la clé GPG du dépôt PostgreSQL - apt_key: + ansible.builtin.apt_key: url: https://www.postgresql.org/media/keys/ACCC4CF8.asc state: present - - name: Ajouter le dépôt PostgreSQL - apt_repository: + - name: Ajouter le dépôt PostgreSQL 16 + ansible.builtin.apt_repository: repo: "deb http://apt.postgresql.org/pub/repos/apt {{ ansible_distribution_release }}-pgdg main" state: present filename: pgdg - - name: Installer PostgreSQL {{ postgres_version }} - apt: + # ============================================================ + # Installation PostgreSQL 16 + # ============================================================ + - name: Installer PostgreSQL 16 + ansible.builtin.apt: name: - - postgresql-{{ postgres_version }} - - postgresql-contrib-{{ postgres_version }} - - python3-psycopg2 + - "postgresql-{{ pg_version }}" + - "postgresql-client-{{ pg_version }}" + - "postgresql-contrib-{{ pg_version }}" state: present update_cache: yes - - name: S'assurer que PostgreSQL est démarré - systemd: + - name: Démarrer et activer PostgreSQL + ansible.builtin.systemd: name: postgresql state: started enabled: yes - - name: Définir le mot de passe du user postgres - postgresql_user: - name: postgres - password: "{{ postgres_password }}" - state: present - become_user: postgres - - - name: Créer les bases de données PostgreSQL - postgresql_db: - name: "{{ item.name }}" - owner: postgres - state: present - loop: "{{ postgres_databases }}" - become_user: postgres - - - name: Configurer pg_hba.conf pour autoriser le backend - blockinfile: - path: "/etc/postgresql/{{ postgres_version }}/main/pg_hba.conf" - block: | - # Connexions locales - local all postgres peer - host all postgres 127.0.0.1/32 scram-sha-256 - # Connexions backend LAN - host all postgres 192.168.1.0/24 scram-sha-256 - marker: "# {mark} ANSIBLE MANAGED BLOCK" - notify: Redémarrer PostgreSQL - tags: - - reload - - - name: Configurer PostgreSQL pour écouter sur toutes les interfaces - lineinfile: - path: "/etc/postgresql/{{ postgres_version }}/main/postgresql.conf" + # ============================================================ + # Configuration PostgreSQL + # ============================================================ + - name: Configurer l'écoute sur localhost + ansible.builtin.lineinfile: + path: "/etc/postgresql/{{ pg_version }}/main/postgresql.conf" regexp: "^#?listen_addresses" - line: "listen_addresses = '*'" + line: "listen_addresses = 'localhost'" + notify: Restart postgresql + + - name: Configurer le port + ansible.builtin.lineinfile: + path: "/etc/postgresql/{{ pg_version }}/main/postgresql.conf" + regexp: "^#?port" + line: "port = {{ db_port }}" + notify: Restart postgresql + + # ============================================================ + # Locale requise + # ============================================================ + - name: Générer la locale fr_FR.UTF-8 + ansible.builtin.command: locale-gen fr_FR.UTF-8 + register: locale_gen + changed_when: "'Generation complete' in locale_gen.stdout" + + - name: Mettre à jour les locales + ansible.builtin.command: update-locale + when: locale_gen.changed + + # ============================================================ + # Création de la base de données et configuration utilisateur + # ============================================================ + - name: Définir le mot de passe de l'utilisateur postgres + become_user: postgres + ansible.builtin.postgresql_user: + name: "{{ db_user }}" + password: "{{ db_password }}" state: present - notify: Redémarrer PostgreSQL - tags: - - reload + + - name: Vérifier si la base de données existe + become_user: postgres + ansible.builtin.command: psql -tAc "SELECT 1 FROM pg_database WHERE datname='{{ db_name }}'" + register: db_exists + changed_when: false + + - name: Créer la base de données avec ICU + become_user: postgres + ansible.builtin.command: > + psql -c "CREATE DATABASE {{ db_name }} + OWNER {{ db_user }} + ENCODING 'UTF8' + LOCALE_PROVIDER icu + ICU_LOCALE 'fr-FR' + TEMPLATE template0" + when: db_exists.stdout != "1" + + - name: Accorder tous les privilèges sur la base + become_user: postgres + ansible.builtin.postgresql_privs: + db: "{{ db_name }}" + role: "{{ db_user }}" + type: database + privs: ALL + state: present + + # ============================================================ + # Authentification pg_hba.conf + # ============================================================ + - name: Configurer l'authentification md5 pour les connexions locales + ansible.builtin.postgresql_pg_hba: + dest: "/etc/postgresql/{{ pg_version }}/main/pg_hba.conf" + contype: host + databases: "{{ db_name }}" + users: "{{ db_user }}" + source: "127.0.0.1/32" + method: md5 + notify: Restart postgresql + + - name: Configurer l'authentification md5 pour IPv6 local + ansible.builtin.postgresql_pg_hba: + dest: "/etc/postgresql/{{ pg_version }}/main/pg_hba.conf" + contype: host + databases: "{{ db_name }}" + users: "{{ db_user }}" + source: "::1/128" + method: md5 + notify: Restart postgresql + + # ============================================================ + # Vérification + # ============================================================ + - name: Vérifier la version de PostgreSQL + become_user: postgres + ansible.builtin.command: psql --version + register: pg_version_check + changed_when: false + + - name: Afficher la version + ansible.builtin.debug: + msg: "{{ pg_version_check.stdout }}" + + - name: Vérifier que la base existe + become_user: postgres + ansible.builtin.command: psql -lqt + register: pg_databases + changed_when: false + + - name: Afficher les bases de données + ansible.builtin.debug: + msg: "{{ pg_databases.stdout_lines }}" handlers: - - name: Redémarrer PostgreSQL - systemd: + - name: Restart postgresql + ansible.builtin.systemd: name: postgresql state: restarted - tags: - - reload # ============================================ # Redis Installation (vm-redis uniquement) # ============================================ - name: Installation et configuration de Redis - hosts: redis + hosts: uber-stup become: true gather_facts: true diff --git a/ansible/templates/backend.service.j2 b/ansible/templates/backend.service.j2 index 9fd3be64..252932d0 100644 --- a/ansible/templates/backend.service.j2 +++ b/ansible/templates/backend.service.j2 @@ -5,6 +5,22 @@ After=network.target [Service] User={{ user_owner }} WorkingDirectory={{ backend_dir }} +Environment="PATH=/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +Environment="USER_JWT_SECRET=TheAmaziNgSecretJwtMotherFuckerInThEbitCh3232131231313443jqfdksdjfjsldfjlds" +Environment="DB_HOST=localhost" +Environment="DB_PORT=5432" +Environment="DB_USER=admin_gestion_commande_db" +Environment="DB_PASSWORD=hb-FS462(#I~6(4',Nt=3Rd4567890jsezZ" +Environment="DB_NAME=gestion_commande_db" +Environment="DB_SSLMODE=disable" +Environment="REDIS_HOST=127.0.0.1" +Environment="REDIS_PORT=6379" +Environment="REDIS_PASSWORD=uQ64h5UhFdrm!H|_cCQer" +Environment="SESSION_SECRET=jfWR21Ywbuy{Yq<1A26TV)jCe" +Environment="GIN_MODE=release" +Environment="TOMTOM_API_KEY=MERY8I7LMeYVSLKO5WuV73W9rKJpBLoB" +Environment="API_PORT={{ backend_local_port }}" +Environment="ADMIN_JWT_SECRET=TheAmaziNgSecretJwtMotherFuckerInThEbitCh3232131231313443jqfdksdjfjsldfjlzZ" ExecStart={{ backend_binary }} Restart=always diff --git a/docker/frontend/custom-rules.conf b/ansible/templates/custom-rules.conf.j2 similarity index 100% rename from docker/frontend/custom-rules.conf rename to ansible/templates/custom-rules.conf.j2 diff --git a/ansible/templates/nginx.conf.j2 b/ansible/templates/nginx.conf.j2 index 3c76ebfa..7570e2de 100644 --- a/ansible/templates/nginx.conf.j2 +++ b/ansible/templates/nginx.conf.j2 @@ -1,79 +1,170 @@ -upstream backend { - server 127.0.0.1:{{ backend_port }} max_fails=3 fail_timeout=30s; - keepalive 32; +# ========================================================= +# Request ID for correlation +# ========================================================= +map $http_x_request_id $req_id { + default $http_x_request_id; + "" $request_id; } +# ========================================================= +# Rate limiting +# ========================================================= +limit_req_zone $binary_remote_addr zone=api:10m rate=30r/m; +limit_req_zone $binary_remote_addr zone=uploads:10m rate=10r/m; + +# ========================================================= +# Upstream backend +# ========================================================= +upstream backend { + server 127.0.0.1:{{ backend_local_port }} max_fails=3 fail_timeout=30s; + keepalive 32; + keepalive_requests 100; + keepalive_timeout 60s; +} + +{% if ssl_enabled %} +# ========================================================= +# HTTP → HTTPS redirect +# ========================================================= server { listen 80; listen [::]:80; - server_name {{ nginx_domain }}; - root {{ nginx_frontend_path }}/dist; - index index.html; + server_name {{ domain_name }}; + return 301 https://$host$request_uri; +} +{% endif %} - access_log /var/log/nginx/{{ nginx_app_name }}.access.log; - error_log /var/log/nginx/{{ nginx_app_name }}.error.log; +# ========================================================= +# API Server +# ========================================================= +server { +{% if ssl_enabled %} + listen {{ backend_port }} ssl; + listen [::]:{{ backend_port }} ssl; + ssl_certificate /etc/letsencrypt/live/{{ domain_name }}/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/{{ domain_name }}/privkey.pem; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305; + ssl_prefer_server_ciphers off; + ssl_session_cache shared:SSL:10m; + ssl_session_timeout 1d; + ssl_session_tickets off; + add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always; +{% else %} + listen {{ backend_port }}; + listen [::]:{{ backend_port }}; +{% endif %} + + server_name {{ domain_name }}; client_max_body_size {{ nginx_max_body_size }}; - location /api/ { - limit_except GET POST PUT DELETE PATCH OPTIONS { - deny all; - } + server_tokens off; - proxy_pass http://backend/; + # ========================================================= + # Security headers + # ========================================================= + add_header X-Frame-Options "DENY" always; + add_header X-Content-Type-Options "nosniff" always; + add_header Referrer-Policy "strict-origin-when-cross-origin" always; + proxy_hide_header X-Powered-By; + proxy_hide_header Server; + + # ========================================================= + # API proxy + # ========================================================= + location / { + limit_req zone=api burst=20 nodelay; + + limit_except GET POST PUT PATCH DELETE OPTIONS { deny all; } + + proxy_pass http://backend; proxy_http_version 1.1; - proxy_set_header Connection ""; + proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Request-ID $req_id; + proxy_set_header Connection ""; - proxy_connect_timeout {{ nginx_proxy_timeout }}s; - proxy_send_timeout {{ nginx_proxy_timeout }}s; - proxy_read_timeout {{ nginx_proxy_timeout }}s; - - proxy_buffering on; - proxy_buffer_size 4k; - proxy_buffers 8 4k; - proxy_no_cache 1; - proxy_cache_bypass 1; + proxy_connect_timeout 60s; + proxy_send_timeout 60s; + proxy_read_timeout 60s; } - location / { - try_files $uri $uri/ /index.html; - add_header Cache-Control "no-cache, no-store, must-revalidate"; - } + # ========================================================= + # Uploads + # ========================================================= + location /uploads/ { + alias {{ uploads_dir }}/; + limit_req zone=uploads burst=20 nodelay; + limit_except GET HEAD { deny all; } - location ~* \.(css|js)$ { - expires {{ nginx_cache_static_duration }}; + # Bloquer les fichiers exécutables + location ~* \.(php|php5|phtml|sh|py|pl|cgi|exe|asp|aspx|jsp)$ { + deny all; + } + + expires 30d; add_header Cache-Control "public, immutable"; - access_log off; + add_header X-Content-Type-Options "nosniff" always; } - location ~* \.(jpg|jpeg|png|gif|ico|svg|woff|woff2|ttf|eot)$ { - expires {{ nginx_cache_media_duration }}; - add_header Cache-Control "public, immutable"; - access_log off; + location ^~ /uploads/images/ { + alias {{ uploads_dir }}/images/; + limit_req zone=uploads burst=20 nodelay; + limit_except GET HEAD OPTIONS { deny all; } + + add_header Access-Control-Allow-Origin "*" always; + add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS" always; + add_header X-Content-Type-Options "nosniff" always; + + expires 30d; + add_header Cache-Control "public, immutable" always; + + types { + image/jpeg jpg jpeg; + image/png png; + image/gif gif; + image/webp webp; + image/svg+xml svg; + } + default_type image/jpeg; } - location = /health { - access_log off; - return 200 "healthy\n"; - add_header Content-Type text/plain; + location ^~ /uploads/videos/ { + alias {{ uploads_dir }}/videos/; + limit_req zone=uploads burst=20 nodelay; + limit_except GET HEAD OPTIONS { deny all; } + + add_header Access-Control-Allow-Origin "*" always; + add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS" always; + add_header X-Content-Type-Options "nosniff" always; + + expires 30d; + add_header Cache-Control "public, immutable" always; + + types { + video/mp4 mp4; + video/webm webm; + video/ogg ogv; + } + default_type video/mp4; } - add_header X-Frame-Options "SAMEORIGIN" always; - add_header X-Content-Type-Options "nosniff" always; - add_header X-XSS-Protection "1; mode=block" always; - add_header Referrer-Policy "strict-origin-when-cross-origin" always; - + # ========================================================= + # Deny hidden files and sensitive files + # ========================================================= location ~ /\. { deny all; access_log off; log_not_found off; } - location ~* (\.env|\.git|package\.json|package-lock\.json|yarn\.lock)$ { + location ~* (\.env|\.git|package\.json|package-lock\.json|yarn\.lock|Dockerfile|docker-compose\.yml)$ { deny all; + access_log off; + log_not_found off; } } diff --git a/backend/gestion/main.go b/backend/gestion/main.go index fcc8eac5..14c1e5cc 100644 --- a/backend/gestion/main.go +++ b/backend/gestion/main.go @@ -89,14 +89,14 @@ func main() { Domain: "", MaxAge: 3600, HttpOnly: true, - Secure: false, - SameSite: http.SameSiteLaxMode, + Secure: true, + SameSite: http.SameSiteStrictMode, }) r.Use(sessions.Sessions("mysession", store)) // Configuration CORS r.Use(cors.New(cors.Config{ - AllowOrigins: []string{"http://172.20.167.237", "http://localhost:5173", "http://localhost:8080", "http://192.168.1.72"}, + AllowOrigins: []string{"https://uber-stup.club"}, AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"}, AllowHeaders: []string{"Origin", "Content-Type", "Accept", "Authorization"}, ExposeHeaders: []string{"Content-Length"}, diff --git a/frontend-admin/.gitignore b/frontend-admin/.gitignore new file mode 100644 index 00000000..cac38cad --- /dev/null +++ b/frontend-admin/.gitignore @@ -0,0 +1,5 @@ +node_modules +.expo +dist +build +*.log diff --git a/frontend-admin/node_modules/.bin/fingerprint b/frontend-admin/node_modules/.bin/fingerprint index f30360da..56eccd03 120000 --- a/frontend-admin/node_modules/.bin/fingerprint +++ b/frontend-admin/node_modules/.bin/fingerprint @@ -1 +1 @@ -../@expo/fingerprint/bin/cli.js \ No newline at end of file +../expo/bin/fingerprint \ No newline at end of file diff --git a/frontend-admin/node_modules/.package-lock.json b/frontend-admin/node_modules/.package-lock.json index 476b1eed..5d9c3cd7 100644 --- a/frontend-admin/node_modules/.package-lock.json +++ b/frontend-admin/node_modules/.package-lock.json @@ -1245,7 +1245,6 @@ "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.27.1.tgz", "integrity": "sha512-fBJKiV7F2DxZUkg5EtHKXQdbsbURW3DZKQUWphDum0uRP6eHGGa/He9mc0mypL680pb+e/lDIthRohlv8NCHkg==", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, @@ -1778,9 +1777,9 @@ } }, "node_modules/@expo/prebuild-config/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "bin": { "semver": "bin/semver.js" }, @@ -3859,12 +3858,12 @@ "integrity": "sha512-87OpwcEiMia/DeiKFzaQNBNFeN3XkkpYIh9FyOqq5mS2oKv3CBE67PXoEKcr6nodWdXNogTiQ0jE2NGuoffXPw==" }, "node_modules/expo": { - "version": "54.0.32", - "resolved": "https://registry.npmjs.org/expo/-/expo-54.0.32.tgz", - "integrity": "sha512-yL9eTxiQ/QKKggVDAWO5CLjUl6IS0lPYgEvC3QM4q4fxd6rs7ks3DnbXSGVU3KNFoY/7cRNYihvd0LKYP+MCXA==", + "version": "54.0.33", + "resolved": "https://registry.npmjs.org/expo/-/expo-54.0.33.tgz", + "integrity": "sha512-3yOEfAKqo+gqHcV8vKcnq0uA5zxlohnhA3fu4G43likN8ct5ZZ3LjAh9wDdKteEkoad3tFPvwxmXW711S5OHUw==", "dependencies": { "@babel/runtime": "^7.20.0", - "@expo/cli": "54.0.22", + "@expo/cli": "54.0.23", "@expo/config": "~12.0.13", "@expo/config-plugins": "~54.0.4", "@expo/devtools": "0.1.8", @@ -4042,9 +4041,9 @@ } }, "node_modules/expo/node_modules/@expo/cli": { - "version": "54.0.22", - "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-54.0.22.tgz", - "integrity": "sha512-BTH2FCczhJLfj1cpfcKrzhKnvRLTOztgW4bVloKDqH+G3ZSohWLRFNAIz56XtdjPxBbi2/qWhGBAkl7kBon/Jw==", + "version": "54.0.23", + "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-54.0.23.tgz", + "integrity": "sha512-km0h72SFfQCmVycH/JtPFTVy69w6Lx1cHNDmfLfQqgKFYeeHTjx7LVDP4POHCtNxFP2UeRazrygJhlh4zz498g==", "dependencies": { "@0no-co/graphql.web": "^1.0.8", "@expo/code-signing-certificates": "^0.0.6", @@ -4153,9 +4152,9 @@ } }, "node_modules/expo/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "bin": { "semver": "bin/semver.js" }, @@ -5901,9 +5900,9 @@ } }, "node_modules/npm-package-arg/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "bin": { "semver": "bin/semver.js" }, @@ -6693,120 +6692,32 @@ } }, "node_modules/react-native-worklets": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/react-native-worklets/-/react-native-worklets-0.7.2.tgz", - "integrity": "sha512-DuLu1kMV/Uyl9pQHp3hehAlThoLw7Yk2FwRTpzASOmI+cd4845FWn3m2bk9MnjUw8FBRIyhwLqYm2AJaXDXsog==", - "peer": true, + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/react-native-worklets/-/react-native-worklets-0.5.1.tgz", + "integrity": "sha512-lJG6Uk9YuojjEX/tQrCbcbmpdLCSFxDK1rJlkDhgqkVi1KZzG7cdcBFQRqyNOOzR9Y0CXNuldmtWTGOyM0k0+w==", "dependencies": { - "@babel/plugin-transform-arrow-functions": "7.27.1", - "@babel/plugin-transform-class-properties": "7.27.1", - "@babel/plugin-transform-classes": "7.28.4", - "@babel/plugin-transform-nullish-coalescing-operator": "7.27.1", - "@babel/plugin-transform-optional-chaining": "7.27.1", - "@babel/plugin-transform-shorthand-properties": "7.27.1", - "@babel/plugin-transform-template-literals": "7.27.1", - "@babel/plugin-transform-unicode-regex": "7.27.1", - "@babel/preset-typescript": "7.27.1", - "convert-source-map": "2.0.0", - "semver": "7.7.3" + "@babel/plugin-transform-arrow-functions": "^7.0.0-0", + "@babel/plugin-transform-class-properties": "^7.0.0-0", + "@babel/plugin-transform-classes": "^7.0.0-0", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.0.0-0", + "@babel/plugin-transform-optional-chaining": "^7.0.0-0", + "@babel/plugin-transform-shorthand-properties": "^7.0.0-0", + "@babel/plugin-transform-template-literals": "^7.0.0-0", + "@babel/plugin-transform-unicode-regex": "^7.0.0-0", + "@babel/preset-typescript": "^7.16.7", + "convert-source-map": "^2.0.0", + "semver": "7.7.2" }, "peerDependencies": { - "@babel/core": "*", + "@babel/core": "^7.0.0-0", "react": "*", "react-native": "*" } }, - "node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.27.1.tgz", - "integrity": "sha512-D0VcalChDMtuRvJIu3U/fwWjf8ZMykz5iZsg77Nuj821vCKI3zCyRLwRdWbsuJ/uRwZhZ002QtCqIkwC/ZkvbA==", - "peer": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.27.1", - "@babel/helper-plugin-utils": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes": { - "version": "7.28.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.28.4.tgz", - "integrity": "sha512-cFOlhIYPBv/iBoc+KS3M6et2XPtbT2HiCRfBXWtfpc9OAyostldxIf9YAYB6ypURBBbx+Qv6nyrLzASfJe+hBA==", - "peer": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.27.3", - "@babel/helper-compilation-targets": "^7.27.2", - "@babel/helper-globals": "^7.28.0", - "@babel/helper-plugin-utils": "^7.27.1", - "@babel/helper-replace-supers": "^7.27.1", - "@babel/traverse": "^7.28.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.27.1.tgz", - "integrity": "sha512-aGZh6xMo6q9vq1JGcw58lZ1Z0+i0xB2x0XaauNIUXd6O1xXc3RwoWEBlsTQrY4KQ9Jf0s5rgD6SiNkaUdJegTA==", - "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.27.1.tgz", - "integrity": "sha512-BQmKPPIuc8EkZgNKsv0X4bPmOoayeu4F1YCwx2/CfmDSXDbp7GnzlUH+/ul5VGfRg1AoFPsrIThlEBj2xb4CAg==", - "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1", - "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/react-native-worklets/node_modules/@babel/preset-typescript": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.27.1.tgz", - "integrity": "sha512-l7WfQfX0WK4M0v2RudjuQK4u99BS6yLHYEmdtVPP7lKV013zr9DygFuWNlnbvQ9LR+LS0Egz/XAvGx5U9MX0fQ==", - "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1", - "@babel/helper-validator-option": "^7.27.1", - "@babel/plugin-syntax-jsx": "^7.27.1", - "@babel/plugin-transform-modules-commonjs": "^7.27.1", - "@babel/plugin-transform-typescript": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/react-native-worklets/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", - "peer": true, + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", "bin": { "semver": "bin/semver.js" }, @@ -7573,9 +7484,9 @@ } }, "node_modules/tar": { - "version": "7.5.7", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.7.tgz", - "integrity": "sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==", + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.9.tgz", + "integrity": "sha512-BTLcK0xsDh2+PUe9F6c2TlRp4zOOBMTkoQHQIWSIzI0R7KG46uEwq4OPk2W7bZcprBMsuaeFsqwYr7pjh6CuHg==", "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", diff --git a/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/README.md b/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/README.md index e9522153..e9d1bc5e 100644 --- a/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/README.md +++ b/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/README.md @@ -110,8 +110,9 @@ Options: -l --loose Interpret versions and ranges loosely --n <0|1> - This is the base to be used for the prerelease identifier. +-n <0|1|false> + Base number for prerelease identifier (default: 0). + Use false to omit the number altogether. -p --include-prerelease Always include prerelease versions in range matching diff --git a/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/bin/semver.js b/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/bin/semver.js index dbb1bf53..d62bfc0e 100755 --- a/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/bin/semver.js +++ b/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/bin/semver.js @@ -105,7 +105,7 @@ const main = () => { versions = versions.map((v) => { return coerce ? (semver.coerce(v, options) || { version: v }).version : v }).filter((v) => { - return semver.valid(v) + return semver.valid(v, options) }) if (!versions.length) { return fail() diff --git a/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/functions/diff.js b/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/functions/diff.js index 04e064e9..c99ab51c 100644 --- a/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/functions/diff.js +++ b/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/functions/diff.js @@ -53,7 +53,7 @@ const diff = (version1, version2) => { return prefix + 'patch' } - // high and low are preleases + // high and low are prereleases return 'prerelease' } diff --git a/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/internal/re.js b/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/internal/re.js index 4758c58d..639fca89 100644 --- a/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/internal/re.js +++ b/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/internal/re.js @@ -78,8 +78,8 @@ createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. -// Non-numberic identifiers include numberic identifiers but can be longer. -// Therefore non-numberic identifiers must go first. +// Non-numeric identifiers include numeric identifiers but can be longer. +// Therefore non-numeric identifiers must go first. createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER] }|${src[t.NUMERICIDENTIFIER]})`) diff --git a/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/package.json b/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/package.json index 2b8cadaa..a84de916 100644 --- a/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/package.json +++ b/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/package.json @@ -1,6 +1,6 @@ { "name": "semver", - "version": "7.7.3", + "version": "7.7.4", "description": "The semantic version parser used by npm.", "main": "index.js", "scripts": { @@ -14,8 +14,8 @@ "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" }, "devDependencies": { - "@npmcli/eslint-config": "^5.0.0", - "@npmcli/template-oss": "4.25.1", + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.29.0", "benchmark": "^2.1.4", "tap": "^16.0.0" }, @@ -52,7 +52,7 @@ "author": "GitHub Inc.", "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.25.1", + "version": "4.29.0", "engines": ">=10", "distPaths": [ "classes/", diff --git a/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/ranges/subset.js b/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/ranges/subset.js index 2c49aef1..99f43218 100644 --- a/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/ranges/subset.js +++ b/frontend-admin/node_modules/@expo/prebuild-config/node_modules/semver/ranges/subset.js @@ -38,7 +38,7 @@ const compare = require('../functions/compare.js') // - If LT // - If LT.semver is greater than any < or <= comp in C, return false // - If LT is <=, and LT.semver does not satisfy every C, return false -// - If GT.semver has a prerelease, and not in prerelease mode +// - If LT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the LT.semver tuple, return false // - Else return true diff --git a/frontend-admin/node_modules/expo/android/build.gradle b/frontend-admin/node_modules/expo/android/build.gradle index fbd0663f..e294b593 100644 --- a/frontend-admin/node_modules/expo/android/build.gradle +++ b/frontend-admin/node_modules/expo/android/build.gradle @@ -32,7 +32,7 @@ buildscript { def reactNativeVersion = project.extensions.getByType(ExpoModuleExtension).reactNativeVersion group = 'host.exp.exponent' -version = '54.0.32' +version = '54.0.33' expoModule { // We can't prebuild the module because it depends on the generated files. @@ -43,7 +43,7 @@ android { namespace "expo.core" defaultConfig { versionCode 1 - versionName "54.0.32" + versionName "54.0.33" consumerProguardFiles("proguard-rules.pro") } testOptions { diff --git a/frontend-admin/node_modules/expo/bundledNativeModules.json b/frontend-admin/node_modules/expo/bundledNativeModules.json index 27badb09..09ddcd15 100644 --- a/frontend-admin/node_modules/expo/bundledNativeModules.json +++ b/frontend-admin/node_modules/expo/bundledNativeModules.json @@ -42,7 +42,7 @@ "expo-document-picker": "~14.0.8", "expo-file-system": "~19.0.21", "expo-font": "~14.0.11", - "expo-gl": "~16.0.9", + "expo-gl": "~16.0.10", "expo-glass-effect": "~0.1.8", "expo-google-app-auth": "~8.3.0", "expo-haptics": "~15.0.8", @@ -71,7 +71,7 @@ "expo-notifications": "~0.32.16", "expo-print": "~15.0.8", "expo-live-photo": "~1.0.8", - "expo-router": "~6.0.22", + "expo-router": "~6.0.23", "expo-screen-capture": "~8.0.9", "expo-screen-orientation": "~9.0.8", "expo-secure-store": "~15.0.8", @@ -92,7 +92,7 @@ "expo-video-thumbnails": "~10.0.8", "expo-video": "~3.0.15", "expo-web-browser": "~15.0.10", - "jest-expo": "~54.0.16", + "jest-expo": "~54.0.17", "lottie-react-native": "~7.3.1", "react": "19.1.0", "react-dom": "19.1.0", diff --git a/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/bin/cli b/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/bin/cli index cf5b44c0..ff2b5996 100755 --- a/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/bin/cli +++ b/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/bin/cli @@ -123,7 +123,7 @@ const args = (0, _arg().default)({ }); if (args['--version']) { // Version is added in the build script. - console.log("54.0.22"); + console.log("54.0.23"); process.exit(0); } if (args['--non-interactive']) { diff --git a/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js b/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js index f9a74663..e246699d 100644 --- a/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js +++ b/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js @@ -15,19 +15,11 @@ function _ws() { }; return data; } -const _net = require("../../../utils/net"); -function createDevToolsPluginWebsocketEndpoint({ serverBaseUrl }) { +function createDevToolsPluginWebsocketEndpoint() { const wss = new (_ws()).WebSocketServer({ noServer: true }); wss.on('connection', (ws, request)=>{ - // Explicitly limit devtools websocket to loopback requests - if (!(0, _net.isLocalSocket)(request.socket) || !(0, _net.isMatchingOrigin)(request, serverBaseUrl)) { - // NOTE: `socket.close` nicely closes the websocket, which will still allow incoming messages - // `socket.terminate` instead forcefully closes down the socket - ws.terminate(); - return; - } ws.on('message', (message, isBinary)=>{ // Broadcast the received message to all other connected clients wss.clients.forEach((client)=>{ diff --git a/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js.map b/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js.map index 0f4875a1..9c7189f5 100644 --- a/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js.map +++ b/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../../../src/start/server/metro/DevToolsPluginWebsocketEndpoint.ts"],"sourcesContent":["import { WebSocket, WebSocketServer } from 'ws';\n\nimport { isLocalSocket, isMatchingOrigin } from '../../../utils/net';\n\ninterface DevToolsPluginWebsocketEndpointParams {\n serverBaseUrl: string;\n}\n\nexport function createDevToolsPluginWebsocketEndpoint({\n serverBaseUrl,\n}: DevToolsPluginWebsocketEndpointParams): Record {\n const wss = new WebSocketServer({ noServer: true });\n\n wss.on('connection', (ws, request) => {\n // Explicitly limit devtools websocket to loopback requests\n if (!isLocalSocket(request.socket) || !isMatchingOrigin(request, serverBaseUrl)) {\n // NOTE: `socket.close` nicely closes the websocket, which will still allow incoming messages\n // `socket.terminate` instead forcefully closes down the socket\n ws.terminate();\n return;\n }\n\n ws.on('message', (message, isBinary) => {\n // Broadcast the received message to all other connected clients\n wss.clients.forEach((client) => {\n if (client !== ws && client.readyState === WebSocket.OPEN) {\n client.send(message, { binary: isBinary });\n }\n });\n });\n });\n\n return { '/expo-dev-plugins/broadcast': wss };\n}\n"],"names":["createDevToolsPluginWebsocketEndpoint","serverBaseUrl","wss","WebSocketServer","noServer","on","ws","request","isLocalSocket","socket","isMatchingOrigin","terminate","message","isBinary","clients","forEach","client","readyState","WebSocket","OPEN","send","binary"],"mappings":";;;;+BAQgBA;;;eAAAA;;;;yBAR2B;;;;;;qBAEK;AAMzC,SAASA,sCAAsC,EACpDC,aAAa,EACyB;IACtC,MAAMC,MAAM,IAAIC,CAAAA,KAAc,iBAAC,CAAC;QAAEC,UAAU;IAAK;IAEjDF,IAAIG,EAAE,CAAC,cAAc,CAACC,IAAIC;QACxB,2DAA2D;QAC3D,IAAI,CAACC,IAAAA,kBAAa,EAACD,QAAQE,MAAM,KAAK,CAACC,IAAAA,qBAAgB,EAACH,SAASN,gBAAgB;YAC/E,6FAA6F;YAC7F,+DAA+D;YAC/DK,GAAGK,SAAS;YACZ;QACF;QAEAL,GAAGD,EAAE,CAAC,WAAW,CAACO,SAASC;YACzB,gEAAgE;YAChEX,IAAIY,OAAO,CAACC,OAAO,CAAC,CAACC;gBACnB,IAAIA,WAAWV,MAAMU,OAAOC,UAAU,KAAKC,eAAS,CAACC,IAAI,EAAE;oBACzDH,OAAOI,IAAI,CAACR,SAAS;wBAAES,QAAQR;oBAAS;gBAC1C;YACF;QACF;IACF;IAEA,OAAO;QAAE,+BAA+BX;IAAI;AAC9C"} \ No newline at end of file +{"version":3,"sources":["../../../../../src/start/server/metro/DevToolsPluginWebsocketEndpoint.ts"],"sourcesContent":["import { WebSocket, WebSocketServer } from 'ws';\n\nexport function createDevToolsPluginWebsocketEndpoint(): Record {\n const wss = new WebSocketServer({ noServer: true });\n\n wss.on('connection', (ws, request) => {\n ws.on('message', (message, isBinary) => {\n // Broadcast the received message to all other connected clients\n wss.clients.forEach((client) => {\n if (client !== ws && client.readyState === WebSocket.OPEN) {\n client.send(message, { binary: isBinary });\n }\n });\n });\n });\n\n return { '/expo-dev-plugins/broadcast': wss };\n}\n"],"names":["createDevToolsPluginWebsocketEndpoint","wss","WebSocketServer","noServer","on","ws","request","message","isBinary","clients","forEach","client","readyState","WebSocket","OPEN","send","binary"],"mappings":";;;;+BAEgBA;;;eAAAA;;;;yBAF2B;;;;;;AAEpC,SAASA;IACd,MAAMC,MAAM,IAAIC,CAAAA,KAAc,iBAAC,CAAC;QAAEC,UAAU;IAAK;IAEjDF,IAAIG,EAAE,CAAC,cAAc,CAACC,IAAIC;QACxBD,GAAGD,EAAE,CAAC,WAAW,CAACG,SAASC;YACzB,gEAAgE;YAChEP,IAAIQ,OAAO,CAACC,OAAO,CAAC,CAACC;gBACnB,IAAIA,WAAWN,MAAMM,OAAOC,UAAU,KAAKC,eAAS,CAACC,IAAI,EAAE;oBACzDH,OAAOI,IAAI,CAACR,SAAS;wBAAES,QAAQR;oBAAS;gBAC1C;YACF;QACF;IACF;IAEA,OAAO;QAAE,+BAA+BP;IAAI;AAC9C"} \ No newline at end of file diff --git a/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/instantiateMetro.js b/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/instantiateMetro.js index 9b41527a..5b783cf3 100644 --- a/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/instantiateMetro.js +++ b/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/instantiateMetro.js @@ -262,9 +262,7 @@ async function instantiateMetroAsync(metroBundler, options, { isExporting, exp = } return middleware.use(metroMiddleware); }; - const devtoolsWebsocketEndpoints = (0, _DevToolsPluginWebsocketEndpoint.createDevToolsPluginWebsocketEndpoint)({ - serverBaseUrl - }); + const devtoolsWebsocketEndpoints = (0, _DevToolsPluginWebsocketEndpoint.createDevToolsPluginWebsocketEndpoint)(); Object.assign(websocketEndpoints, devtoolsWebsocketEndpoints); } // Attach Expo Atlas if enabled diff --git a/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/instantiateMetro.js.map b/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/instantiateMetro.js.map index b43d0cbf..3b18f1db 100644 --- a/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/instantiateMetro.js.map +++ b/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/start/server/metro/instantiateMetro.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../../../src/start/server/metro/instantiateMetro.ts"],"sourcesContent":["import { type ExpoConfig, getConfig } from '@expo/config';\nimport { getMetroServerRoot } from '@expo/config/paths';\nimport type { Reporter } from '@expo/metro/metro';\nimport type Bundler from '@expo/metro/metro/Bundler';\nimport type { ReadOnlyGraph } from '@expo/metro/metro/DeltaBundler';\nimport type { TransformOptions } from '@expo/metro/metro/DeltaBundler/Worker';\nimport MetroHmrServer, { Client as MetroHmrClient } from '@expo/metro/metro/HmrServer';\nimport RevisionNotFoundError from '@expo/metro/metro/IncrementalBundler/RevisionNotFoundError';\nimport type MetroServer from '@expo/metro/metro/Server';\nimport formatBundlingError from '@expo/metro/metro/lib/formatBundlingError';\nimport { mergeConfig, resolveConfig, type ConfigT } from '@expo/metro/metro-config';\nimport { Terminal } from '@expo/metro/metro-core';\nimport { getDefaultConfig } from '@expo/metro-config';\nimport chalk from 'chalk';\nimport http from 'http';\nimport path from 'path';\n\nimport { createDevToolsPluginWebsocketEndpoint } from './DevToolsPluginWebsocketEndpoint';\nimport { MetroBundlerDevServer } from './MetroBundlerDevServer';\nimport { MetroTerminalReporter } from './MetroTerminalReporter';\nimport { attachAtlasAsync } from './debugging/attachAtlas';\nimport { createDebugMiddleware } from './debugging/createDebugMiddleware';\nimport { createMetroMiddleware } from './dev-server/createMetroMiddleware';\nimport { runServer } from './runServer-fork';\nimport { withMetroMultiPlatformAsync } from './withMetroMultiPlatform';\nimport { Log } from '../../../log';\nimport { env } from '../../../utils/env';\nimport { CommandError } from '../../../utils/errors';\nimport { createCorsMiddleware } from '../middleware/CorsMiddleware';\nimport { createJsInspectorMiddleware } from '../middleware/inspector/createJsInspectorMiddleware';\nimport { prependMiddleware } from '../middleware/mutations';\nimport { getPlatformBundlers } from '../platformBundlers';\n\n// From expo/dev-server but with ability to use custom logger.\ntype MessageSocket = {\n broadcast: (method: string, params?: Record | undefined) => void;\n};\n\n// Wrap terminal and polyfill console.log so we can log during bundling without breaking the indicator.\nclass LogRespectingTerminal extends Terminal {\n constructor(stream: import('node:net').Socket | import('node:stream').Writable) {\n super(stream, { ttyPrint: true });\n\n const sendLog = (...msg: any[]) => {\n if (!msg.length) {\n this.log('');\n } else {\n const [format, ...args] = msg;\n this.log(format, ...args);\n }\n // Flush the logs to the terminal immediately so logs at the end of the process are not lost.\n this.flush();\n };\n\n console.log = sendLog;\n console.info = sendLog;\n }\n}\n\n// Share one instance of Terminal for all instances of Metro.\nconst terminal = new LogRespectingTerminal(process.stdout);\n\ninterface LoadMetroConfigOptions {\n maxWorkers?: number;\n port?: number;\n reporter?: Reporter;\n resetCache?: boolean;\n}\n\nexport async function loadMetroConfigAsync(\n projectRoot: string,\n options: LoadMetroConfigOptions,\n {\n exp,\n isExporting,\n getMetroBundler,\n }: { exp: ExpoConfig; isExporting: boolean; getMetroBundler: () => Bundler }\n) {\n let reportEvent: ((event: any) => void) | undefined;\n\n const autolinkingModuleResolutionEnabled =\n exp.experiments?.autolinkingModuleResolution ?? env.EXPO_USE_STICKY_RESOLVER;\n\n const serverActionsEnabled =\n exp.experiments?.reactServerFunctions ?? env.EXPO_UNSTABLE_SERVER_FUNCTIONS;\n\n if (serverActionsEnabled) {\n process.env.EXPO_UNSTABLE_SERVER_FUNCTIONS = '1';\n }\n\n // NOTE: Enable all the experimental Metro flags when RSC is enabled.\n if (exp.experiments?.reactServerComponentRoutes || serverActionsEnabled) {\n process.env.EXPO_USE_METRO_REQUIRE = '1';\n }\n\n const isReactCanaryEnabled =\n (exp.experiments?.reactServerComponentRoutes ||\n serverActionsEnabled ||\n exp.experiments?.reactCanary) ??\n false;\n\n const serverRoot = getMetroServerRoot(projectRoot);\n const terminalReporter = new MetroTerminalReporter(serverRoot, terminal);\n\n // NOTE: Allow external tools to override the metro config. This is considered internal and unstable\n const configPath = env.EXPO_OVERRIDE_METRO_CONFIG ?? undefined;\n const resolvedConfig = await resolveConfig(configPath, projectRoot);\n const defaultConfig = getDefaultConfig(projectRoot);\n\n let config: ConfigT = resolvedConfig.isEmpty\n ? defaultConfig\n : await mergeConfig(defaultConfig, resolvedConfig.config);\n\n // Set the watchfolders to include the projectRoot, as Metro assumes this\n // Force-override the reporter\n config = {\n ...config,\n\n // See: `overrideConfigWithArguments` https://github.com/facebook/metro/blob/5059e26/packages/metro-config/src/loadConfig.js#L274-L339\n // Compare to `LoadOptions` type (disregard `reporter` as we don't expose this)\n resetCache: !!options.resetCache,\n maxWorkers: options.maxWorkers ?? config.maxWorkers,\n server: {\n ...config.server,\n port: options.port ?? config.server.port,\n },\n\n watchFolders: !config.watchFolders.includes(config.projectRoot)\n ? [config.projectRoot, ...config.watchFolders]\n : config.watchFolders,\n reporter: {\n update(event) {\n terminalReporter.update(event);\n if (reportEvent) {\n reportEvent(event);\n }\n },\n },\n };\n\n // @ts-expect-error: Set the global require cycle ignore patterns for SSR bundles. This won't work with custom global prefixes, but we don't use those.\n globalThis.__requireCycleIgnorePatterns = config.resolver?.requireCycleIgnorePatterns;\n\n if (isExporting) {\n // This token will be used in the asset plugin to ensure the path is correct for writing locally.\n // @ts-expect-error: typed as readonly.\n config.transformer.publicPath = `/assets?export_path=${\n (exp.experiments?.baseUrl ?? '') + '/assets'\n }`;\n } else {\n // @ts-expect-error: typed as readonly\n config.transformer.publicPath = '/assets/?unstable_path=.';\n }\n\n const platformBundlers = getPlatformBundlers(projectRoot, exp);\n\n if (exp.experiments?.reactCompiler) {\n Log.log(chalk.gray`React Compiler enabled`);\n }\n\n if (env.EXPO_UNSTABLE_TREE_SHAKING && !env.EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH) {\n throw new CommandError(\n 'EXPO_UNSTABLE_TREE_SHAKING requires EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH to be enabled.'\n );\n }\n\n if (env.EXPO_UNSTABLE_TREE_SHAKING) {\n Log.warn(`Experimental fast resolver is enabled.`);\n }\n if (env.EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH) {\n Log.warn(`Experimental bundle optimization is enabled.`);\n }\n if (env.EXPO_UNSTABLE_TREE_SHAKING) {\n Log.warn(`Experimental tree shaking is enabled.`);\n }\n if (autolinkingModuleResolutionEnabled) {\n Log.warn(`Experimental Expo Autolinking module resolver is enabled.`);\n }\n\n if (serverActionsEnabled) {\n Log.warn(\n `React Server Functions (beta) are enabled. Route rendering mode: ${exp.experiments?.reactServerComponentRoutes ? 'server' : 'client'}`\n );\n }\n\n config = await withMetroMultiPlatformAsync(projectRoot, {\n config,\n exp,\n platformBundlers,\n isTsconfigPathsEnabled: exp.experiments?.tsconfigPaths ?? true,\n isAutolinkingResolverEnabled: autolinkingModuleResolutionEnabled,\n isFastResolverEnabled: env.EXPO_USE_FAST_RESOLVER,\n isExporting,\n isReactCanaryEnabled,\n isNamedRequiresEnabled: env.EXPO_USE_METRO_REQUIRE,\n isReactServerComponentsEnabled: !!exp.experiments?.reactServerComponentRoutes,\n getMetroBundler,\n });\n\n return {\n config,\n setEventReporter: (logger: (event: any) => void) => (reportEvent = logger),\n reporter: terminalReporter,\n };\n}\n\n/** The most generic possible setup for Metro bundler. */\nexport async function instantiateMetroAsync(\n metroBundler: MetroBundlerDevServer,\n options: LoadMetroConfigOptions,\n {\n isExporting,\n exp = getConfig(metroBundler.projectRoot, {\n skipSDKVersionRequirement: true,\n }).exp,\n }: { isExporting: boolean; exp?: ExpoConfig }\n): Promise<{\n metro: MetroServer;\n hmrServer: MetroHmrServer | null;\n server: http.Server;\n middleware: any;\n messageSocket: MessageSocket;\n}> {\n const projectRoot = metroBundler.projectRoot;\n\n const {\n config: metroConfig,\n setEventReporter,\n reporter,\n } = await loadMetroConfigAsync(projectRoot, options, {\n exp,\n isExporting,\n getMetroBundler() {\n return metro.getBundler().getBundler();\n },\n });\n\n // Create the core middleware stack for Metro, including websocket listeners\n const { middleware, messagesSocket, eventsSocket, websocketEndpoints } =\n createMetroMiddleware(metroConfig);\n\n // Get local URL to Metro bundler server (typically configured as 127.0.0.1:8081)\n const serverBaseUrl = metroBundler\n .getUrlCreator()\n .constructUrl({ scheme: 'http', hostType: 'localhost' });\n\n if (!isExporting) {\n // Enable correct CORS headers for Expo Router features\n prependMiddleware(middleware, createCorsMiddleware(exp));\n\n // Enable debug middleware for CDP-related debugging\n const { debugMiddleware, debugWebsocketEndpoints } = createDebugMiddleware({\n projectRoot: metroBundler.projectRoot,\n serverBaseUrl,\n reporter,\n });\n Object.assign(websocketEndpoints, debugWebsocketEndpoints);\n middleware.use(debugMiddleware);\n middleware.use('/_expo/debugger', createJsInspectorMiddleware());\n\n // TODO(cedric): `enhanceMiddleware` is deprecated, but is currently used to unify the middleware stacks\n // See: https://github.com/facebook/metro/commit/22e85fde85ec454792a1b70eba4253747a2587a9\n // See: https://github.com/facebook/metro/commit/d0d554381f119bb80ab09dbd6a1d310b54737e52\n const customEnhanceMiddleware = metroConfig.server.enhanceMiddleware;\n // @ts-expect-error: can't mutate readonly config\n metroConfig.server.enhanceMiddleware = (metroMiddleware: any, server: MetroServer) => {\n if (customEnhanceMiddleware) {\n metroMiddleware = customEnhanceMiddleware(metroMiddleware, server);\n }\n return middleware.use(metroMiddleware);\n };\n\n const devtoolsWebsocketEndpoints = createDevToolsPluginWebsocketEndpoint({ serverBaseUrl });\n Object.assign(websocketEndpoints, devtoolsWebsocketEndpoints);\n }\n\n // Attach Expo Atlas if enabled\n await attachAtlasAsync({\n isExporting,\n exp,\n projectRoot,\n middleware,\n metroConfig,\n // NOTE(cedric): reset the Atlas file once, and reuse it for static exports\n resetAtlasFile: isExporting,\n });\n\n const { server, hmrServer, metro } = await runServer(\n metroBundler,\n metroConfig,\n {\n websocketEndpoints,\n watch: !isExporting && isWatchEnabled(),\n },\n {\n mockServer: isExporting,\n }\n );\n\n // Patch transform file to remove inconvenient customTransformOptions which are only used in single well-known files.\n const originalTransformFile = metro\n .getBundler()\n .getBundler()\n .transformFile.bind(metro.getBundler().getBundler());\n\n metro.getBundler().getBundler().transformFile = async function (\n filePath: string,\n transformOptions: TransformOptions,\n fileBuffer?: Buffer\n ) {\n return originalTransformFile(\n filePath,\n pruneCustomTransformOptions(\n filePath,\n // Clone the options so we don't mutate the original.\n {\n ...transformOptions,\n customTransformOptions: {\n __proto__: null,\n ...transformOptions.customTransformOptions,\n },\n }\n ),\n fileBuffer\n );\n };\n\n setEventReporter(eventsSocket.reportMetroEvent);\n\n // This function ensures that modules in source maps are sorted in the same\n // order as in a plain JS bundle.\n metro._getSortedModules = function (this: MetroServer, graph: ReadOnlyGraph) {\n const modules = [...graph.dependencies.values()];\n\n const ctx = {\n platform: graph.transformOptions.platform,\n environment: graph.transformOptions.customTransformOptions?.environment,\n };\n // Assign IDs to modules in a consistent order\n for (const module of modules) {\n // @ts-expect-error\n this._createModuleId(module.path, ctx);\n }\n // Sort by IDs\n return modules.sort(\n // @ts-expect-error\n (a, b) => this._createModuleId(a.path, ctx) - this._createModuleId(b.path, ctx)\n );\n };\n\n if (hmrServer) {\n let hmrJSBundle:\n | typeof import('@expo/metro-config/build/serializer/fork/hmrJSBundle').default\n | typeof import('@expo/metro/metro/DeltaBundler/Serializers/hmrJSBundle').default;\n\n try {\n hmrJSBundle = require('@expo/metro-config/build/serializer/fork/hmrJSBundle').default;\n } catch {\n // TODO: Add fallback for monorepo tests up until the fork is merged.\n Log.warn('Failed to load HMR serializer from @expo/metro-config, using fallback version.');\n hmrJSBundle = require('@expo/metro/metro/DeltaBundler/Serializers/hmrJSBundle');\n }\n\n // Patch HMR Server to send more info to the `_createModuleId` function for deterministic module IDs and add support for serializing HMR updates the same as all other bundles.\n hmrServer._prepareMessage = async function (\n this: MetroHmrServer,\n group,\n options,\n changeEvent\n ) {\n // Fork of https://github.com/facebook/metro/blob/3b3e0aaf725cfa6907bf2c8b5fbc0da352d29efe/packages/metro/src/HmrServer.js#L327-L393\n // with patch for `_createModuleId`.\n const logger = !options.isInitialUpdate ? changeEvent?.logger : null;\n try {\n const revPromise = this._bundler.getRevision(group.revisionId);\n if (!revPromise) {\n return {\n type: 'error',\n body: formatBundlingError(new RevisionNotFoundError(group.revisionId)),\n };\n }\n logger?.point('updateGraph_start');\n const { revision, delta } = await this._bundler.updateGraph(await revPromise, false);\n logger?.point('updateGraph_end');\n this._clientGroups.delete(group.revisionId);\n group.revisionId = revision.id;\n for (const client of group.clients) {\n client.revisionIds = client.revisionIds.filter(\n (revisionId) => revisionId !== group.revisionId\n );\n client.revisionIds.push(revision.id);\n }\n this._clientGroups.set(group.revisionId, group);\n logger?.point('serialize_start');\n // NOTE(EvanBacon): This is the patch\n const moduleIdContext = {\n platform: revision.graph.transformOptions.platform,\n environment: revision.graph.transformOptions.customTransformOptions?.environment,\n };\n const hmrUpdate = hmrJSBundle(delta, revision.graph, {\n clientUrl: group.clientUrl,\n // NOTE(EvanBacon): This is also the patch\n createModuleId: (moduleId: string) => {\n // @ts-expect-error\n return this._createModuleId(moduleId, moduleIdContext);\n },\n includeAsyncPaths: group.graphOptions.lazy,\n projectRoot: this._config.projectRoot,\n serverRoot: this._config.server.unstable_serverRoot ?? this._config.projectRoot,\n });\n logger?.point('serialize_end');\n return {\n type: 'update',\n body: {\n revisionId: revision.id,\n isInitialUpdate: options.isInitialUpdate,\n ...hmrUpdate,\n },\n };\n } catch (error: any) {\n const formattedError = formatBundlingError(error);\n this._config.reporter.update({\n type: 'bundling_error',\n error,\n });\n return {\n type: 'error',\n body: formattedError,\n };\n }\n };\n }\n\n return {\n metro,\n hmrServer,\n server,\n middleware,\n messageSocket: messagesSocket,\n };\n}\n\n// TODO: Fork the entire transform function so we can simply regex the file contents for keywords instead.\nfunction pruneCustomTransformOptions(\n filePath: string,\n transformOptions: TransformOptions\n): TransformOptions {\n // Normalize the filepath for cross platform checking.\n filePath = filePath.split(path.sep).join('/');\n\n if (\n transformOptions.customTransformOptions?.dom &&\n // The only generated file that needs the dom root is `expo/dom/entry.js`\n !filePath.match(/expo\\/dom\\/entry\\.js$/)\n ) {\n // Clear the dom root option if we aren't transforming the magic entry file, this ensures\n // that cached artifacts from other DOM component bundles can be reused.\n transformOptions.customTransformOptions.dom = 'true';\n }\n\n if (\n transformOptions.customTransformOptions?.routerRoot &&\n // The router root is used all over expo-router (`process.env.EXPO_ROUTER_ABS_APP_ROOT`, `process.env.EXPO_ROUTER_APP_ROOT`) so we'll just ignore the entire package.\n !(filePath.match(/\\/expo-router\\/_ctx/) || filePath.match(/\\/expo-router\\/build\\//))\n ) {\n // Set to the default value.\n transformOptions.customTransformOptions.routerRoot = 'app';\n }\n\n if (\n transformOptions.customTransformOptions?.asyncRoutes &&\n // The async routes settings are also used in `expo-router/_ctx.ios.js` (and other platform variants) via `process.env.EXPO_ROUTER_IMPORT_MODE`\n !(filePath.match(/\\/expo-router\\/_ctx/) || filePath.match(/\\/expo-router\\/build\\//))\n ) {\n delete transformOptions.customTransformOptions.asyncRoutes;\n }\n\n if (\n transformOptions.customTransformOptions?.clientBoundaries &&\n // The client boundaries are only used in `expo/virtual/rsc.js` for production RSC exports.\n !filePath.match(/\\/expo\\/virtual\\/rsc\\.js$/)\n ) {\n delete transformOptions.customTransformOptions.clientBoundaries;\n }\n\n return transformOptions;\n}\n\n/**\n * Simplify and communicate if Metro is running without watching file updates,.\n * Exposed for testing.\n */\nexport function isWatchEnabled() {\n if (env.CI) {\n Log.log(\n chalk`Metro is running in CI mode, reloads are disabled. Remove {bold CI=true} to enable watch mode.`\n );\n }\n\n return !env.CI;\n}\n"],"names":["instantiateMetroAsync","isWatchEnabled","loadMetroConfigAsync","LogRespectingTerminal","Terminal","constructor","stream","ttyPrint","sendLog","msg","length","log","format","args","flush","console","info","terminal","process","stdout","projectRoot","options","exp","isExporting","getMetroBundler","config","reportEvent","autolinkingModuleResolutionEnabled","experiments","autolinkingModuleResolution","env","EXPO_USE_STICKY_RESOLVER","serverActionsEnabled","reactServerFunctions","EXPO_UNSTABLE_SERVER_FUNCTIONS","reactServerComponentRoutes","EXPO_USE_METRO_REQUIRE","isReactCanaryEnabled","reactCanary","serverRoot","getMetroServerRoot","terminalReporter","MetroTerminalReporter","configPath","EXPO_OVERRIDE_METRO_CONFIG","undefined","resolvedConfig","resolveConfig","defaultConfig","getDefaultConfig","isEmpty","mergeConfig","resetCache","maxWorkers","server","port","watchFolders","includes","reporter","update","event","globalThis","__requireCycleIgnorePatterns","resolver","requireCycleIgnorePatterns","transformer","publicPath","baseUrl","platformBundlers","getPlatformBundlers","reactCompiler","Log","chalk","gray","EXPO_UNSTABLE_TREE_SHAKING","EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH","CommandError","warn","withMetroMultiPlatformAsync","isTsconfigPathsEnabled","tsconfigPaths","isAutolinkingResolverEnabled","isFastResolverEnabled","EXPO_USE_FAST_RESOLVER","isNamedRequiresEnabled","isReactServerComponentsEnabled","setEventReporter","logger","metroBundler","getConfig","skipSDKVersionRequirement","metroConfig","metro","getBundler","middleware","messagesSocket","eventsSocket","websocketEndpoints","createMetroMiddleware","serverBaseUrl","getUrlCreator","constructUrl","scheme","hostType","prependMiddleware","createCorsMiddleware","debugMiddleware","debugWebsocketEndpoints","createDebugMiddleware","Object","assign","use","createJsInspectorMiddleware","customEnhanceMiddleware","enhanceMiddleware","metroMiddleware","devtoolsWebsocketEndpoints","createDevToolsPluginWebsocketEndpoint","attachAtlasAsync","resetAtlasFile","hmrServer","runServer","watch","mockServer","originalTransformFile","transformFile","bind","filePath","transformOptions","fileBuffer","pruneCustomTransformOptions","customTransformOptions","__proto__","reportMetroEvent","_getSortedModules","graph","modules","dependencies","values","ctx","platform","environment","module","_createModuleId","path","sort","a","b","hmrJSBundle","require","default","_prepareMessage","group","changeEvent","isInitialUpdate","revision","revPromise","_bundler","getRevision","revisionId","type","body","formatBundlingError","RevisionNotFoundError","point","delta","updateGraph","_clientGroups","delete","id","client","clients","revisionIds","filter","push","set","moduleIdContext","hmrUpdate","clientUrl","createModuleId","moduleId","includeAsyncPaths","graphOptions","lazy","_config","unstable_serverRoot","error","formattedError","messageSocket","split","sep","join","dom","match","routerRoot","asyncRoutes","clientBoundaries","CI"],"mappings":";;;;;;;;;;;IA+MsBA,qBAAqB;eAArBA;;IA6RNC,cAAc;eAAdA;;IAvaMC,oBAAoB;eAApBA;;;;yBArEqB;;;;;;;yBACR;;;;;;;gEAMD;;;;;;;gEAEF;;;;;;;yBACyB;;;;;;;y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WAAW;IAC5D;IAEA,IACEnE,EAAAA,4CAAAA,iBAAiBG,sBAAsB,qBAAvCH,0CAAyCoE,gBAAgB,KACzD,2FAA2F;IAC3F,CAACrE,SAASkE,KAAK,CAAC,8BAChB;QACA,OAAOjE,iBAAiBG,sBAAsB,CAACiE,gBAAgB;IACjE;IAEA,OAAOpE;AACT;AAMO,SAAS/H;IACd,IAAI6B,QAAG,CAACuK,EAAE,EAAE;QACV9H,QAAG,CAAC5D,GAAG,CACL6D,IAAAA,gBAAK,CAAA,CAAC,8FAA8F,CAAC;IAEzG;IAEA,OAAO,CAAC1C,QAAG,CAACuK,EAAE;AAChB"} \ No newline at end of file +{"version":3,"sources":["../../../../../src/start/server/metro/instantiateMetro.ts"],"sourcesContent":["import { type ExpoConfig, getConfig } from '@expo/config';\nimport { getMetroServerRoot } from '@expo/config/paths';\nimport type { Reporter } from '@expo/metro/metro';\nimport type Bundler from '@expo/metro/metro/Bundler';\nimport type { ReadOnlyGraph } from '@expo/metro/metro/DeltaBundler';\nimport type { TransformOptions } from '@expo/metro/metro/DeltaBundler/Worker';\nimport MetroHmrServer, { Client as MetroHmrClient } from '@expo/metro/metro/HmrServer';\nimport RevisionNotFoundError from '@expo/metro/metro/IncrementalBundler/RevisionNotFoundError';\nimport type MetroServer from '@expo/metro/metro/Server';\nimport formatBundlingError from '@expo/metro/metro/lib/formatBundlingError';\nimport { mergeConfig, resolveConfig, type ConfigT } from '@expo/metro/metro-config';\nimport { Terminal } from '@expo/metro/metro-core';\nimport { getDefaultConfig } from '@expo/metro-config';\nimport chalk from 'chalk';\nimport http from 'http';\nimport path from 'path';\n\nimport { createDevToolsPluginWebsocketEndpoint } from './DevToolsPluginWebsocketEndpoint';\nimport { MetroBundlerDevServer } from './MetroBundlerDevServer';\nimport { MetroTerminalReporter } from './MetroTerminalReporter';\nimport { attachAtlasAsync } from './debugging/attachAtlas';\nimport { createDebugMiddleware } from './debugging/createDebugMiddleware';\nimport { createMetroMiddleware } from './dev-server/createMetroMiddleware';\nimport { runServer } from './runServer-fork';\nimport { withMetroMultiPlatformAsync } from './withMetroMultiPlatform';\nimport { Log } from '../../../log';\nimport { env } from '../../../utils/env';\nimport { CommandError } from '../../../utils/errors';\nimport { createCorsMiddleware } from '../middleware/CorsMiddleware';\nimport { createJsInspectorMiddleware } from '../middleware/inspector/createJsInspectorMiddleware';\nimport { prependMiddleware } from '../middleware/mutations';\nimport { getPlatformBundlers } from '../platformBundlers';\n\n// From expo/dev-server but with ability to use custom logger.\ntype MessageSocket = {\n broadcast: (method: string, params?: Record | undefined) => void;\n};\n\n// Wrap terminal and polyfill console.log so we can log during bundling without breaking the indicator.\nclass LogRespectingTerminal extends Terminal {\n constructor(stream: import('node:net').Socket | import('node:stream').Writable) {\n super(stream, { ttyPrint: true });\n\n const sendLog = (...msg: any[]) => {\n if (!msg.length) {\n this.log('');\n } else {\n const [format, ...args] = msg;\n this.log(format, ...args);\n }\n // Flush the logs to the terminal immediately so logs at the end of the process are not lost.\n this.flush();\n };\n\n console.log = sendLog;\n console.info = sendLog;\n }\n}\n\n// Share one instance of Terminal for all instances of Metro.\nconst terminal = new LogRespectingTerminal(process.stdout);\n\ninterface LoadMetroConfigOptions {\n maxWorkers?: number;\n port?: number;\n reporter?: Reporter;\n resetCache?: boolean;\n}\n\nexport async function loadMetroConfigAsync(\n projectRoot: string,\n options: LoadMetroConfigOptions,\n {\n exp,\n isExporting,\n getMetroBundler,\n }: { exp: ExpoConfig; isExporting: boolean; getMetroBundler: () => Bundler }\n) {\n let reportEvent: ((event: any) => void) | undefined;\n\n const autolinkingModuleResolutionEnabled =\n exp.experiments?.autolinkingModuleResolution ?? env.EXPO_USE_STICKY_RESOLVER;\n\n const serverActionsEnabled =\n exp.experiments?.reactServerFunctions ?? env.EXPO_UNSTABLE_SERVER_FUNCTIONS;\n\n if (serverActionsEnabled) {\n process.env.EXPO_UNSTABLE_SERVER_FUNCTIONS = '1';\n }\n\n // NOTE: Enable all the experimental Metro flags when RSC is enabled.\n if (exp.experiments?.reactServerComponentRoutes || serverActionsEnabled) {\n process.env.EXPO_USE_METRO_REQUIRE = '1';\n }\n\n const isReactCanaryEnabled =\n (exp.experiments?.reactServerComponentRoutes ||\n serverActionsEnabled ||\n exp.experiments?.reactCanary) ??\n false;\n\n const serverRoot = getMetroServerRoot(projectRoot);\n const terminalReporter = new MetroTerminalReporter(serverRoot, terminal);\n\n // NOTE: Allow external tools to override the metro config. This is considered internal and unstable\n const configPath = env.EXPO_OVERRIDE_METRO_CONFIG ?? undefined;\n const resolvedConfig = await resolveConfig(configPath, projectRoot);\n const defaultConfig = getDefaultConfig(projectRoot);\n\n let config: ConfigT = resolvedConfig.isEmpty\n ? defaultConfig\n : await mergeConfig(defaultConfig, resolvedConfig.config);\n\n // Set the watchfolders to include the projectRoot, as Metro assumes this\n // Force-override the reporter\n config = {\n ...config,\n\n // See: `overrideConfigWithArguments` https://github.com/facebook/metro/blob/5059e26/packages/metro-config/src/loadConfig.js#L274-L339\n // Compare to `LoadOptions` type (disregard `reporter` as we don't expose this)\n resetCache: !!options.resetCache,\n maxWorkers: options.maxWorkers ?? config.maxWorkers,\n server: {\n ...config.server,\n port: options.port ?? config.server.port,\n },\n\n watchFolders: !config.watchFolders.includes(config.projectRoot)\n ? [config.projectRoot, ...config.watchFolders]\n : config.watchFolders,\n reporter: {\n update(event) {\n terminalReporter.update(event);\n if (reportEvent) {\n reportEvent(event);\n }\n },\n },\n };\n\n // @ts-expect-error: Set the global require cycle ignore patterns for SSR bundles. This won't work with custom global prefixes, but we don't use those.\n globalThis.__requireCycleIgnorePatterns = config.resolver?.requireCycleIgnorePatterns;\n\n if (isExporting) {\n // This token will be used in the asset plugin to ensure the path is correct for writing locally.\n // @ts-expect-error: typed as readonly.\n config.transformer.publicPath = `/assets?export_path=${\n (exp.experiments?.baseUrl ?? '') + '/assets'\n }`;\n } else {\n // @ts-expect-error: typed as readonly\n config.transformer.publicPath = '/assets/?unstable_path=.';\n }\n\n const platformBundlers = getPlatformBundlers(projectRoot, exp);\n\n if (exp.experiments?.reactCompiler) {\n Log.log(chalk.gray`React Compiler enabled`);\n }\n\n if (env.EXPO_UNSTABLE_TREE_SHAKING && !env.EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH) {\n throw new CommandError(\n 'EXPO_UNSTABLE_TREE_SHAKING requires EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH to be enabled.'\n );\n }\n\n if (env.EXPO_UNSTABLE_TREE_SHAKING) {\n Log.warn(`Experimental fast resolver is enabled.`);\n }\n if (env.EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH) {\n Log.warn(`Experimental bundle optimization is enabled.`);\n }\n if (env.EXPO_UNSTABLE_TREE_SHAKING) {\n Log.warn(`Experimental tree shaking is enabled.`);\n }\n if (autolinkingModuleResolutionEnabled) {\n Log.warn(`Experimental Expo Autolinking module resolver is enabled.`);\n }\n\n if (serverActionsEnabled) {\n Log.warn(\n `React Server Functions (beta) are enabled. Route rendering mode: ${exp.experiments?.reactServerComponentRoutes ? 'server' : 'client'}`\n );\n }\n\n config = await withMetroMultiPlatformAsync(projectRoot, {\n config,\n exp,\n platformBundlers,\n isTsconfigPathsEnabled: exp.experiments?.tsconfigPaths ?? true,\n isAutolinkingResolverEnabled: autolinkingModuleResolutionEnabled,\n isFastResolverEnabled: env.EXPO_USE_FAST_RESOLVER,\n isExporting,\n isReactCanaryEnabled,\n isNamedRequiresEnabled: env.EXPO_USE_METRO_REQUIRE,\n isReactServerComponentsEnabled: !!exp.experiments?.reactServerComponentRoutes,\n getMetroBundler,\n });\n\n return {\n config,\n setEventReporter: (logger: (event: any) => void) => (reportEvent = logger),\n reporter: terminalReporter,\n };\n}\n\n/** The most generic possible setup for Metro bundler. */\nexport async function instantiateMetroAsync(\n metroBundler: MetroBundlerDevServer,\n options: LoadMetroConfigOptions,\n {\n isExporting,\n exp = getConfig(metroBundler.projectRoot, {\n skipSDKVersionRequirement: true,\n }).exp,\n }: { isExporting: boolean; exp?: ExpoConfig }\n): Promise<{\n metro: MetroServer;\n hmrServer: MetroHmrServer | null;\n server: http.Server;\n middleware: any;\n messageSocket: MessageSocket;\n}> {\n const projectRoot = metroBundler.projectRoot;\n\n const {\n config: metroConfig,\n setEventReporter,\n reporter,\n } = await loadMetroConfigAsync(projectRoot, options, {\n exp,\n isExporting,\n getMetroBundler() {\n return metro.getBundler().getBundler();\n },\n });\n\n // Create the core middleware stack for Metro, including websocket listeners\n const { middleware, messagesSocket, eventsSocket, websocketEndpoints } =\n createMetroMiddleware(metroConfig);\n\n // Get local URL to Metro bundler server (typically configured as 127.0.0.1:8081)\n const serverBaseUrl = metroBundler\n .getUrlCreator()\n .constructUrl({ scheme: 'http', hostType: 'localhost' });\n\n if (!isExporting) {\n // Enable correct CORS headers for Expo Router features\n prependMiddleware(middleware, createCorsMiddleware(exp));\n\n // Enable debug middleware for CDP-related debugging\n const { debugMiddleware, debugWebsocketEndpoints } = createDebugMiddleware({\n projectRoot: metroBundler.projectRoot,\n serverBaseUrl,\n reporter,\n });\n Object.assign(websocketEndpoints, debugWebsocketEndpoints);\n middleware.use(debugMiddleware);\n middleware.use('/_expo/debugger', createJsInspectorMiddleware());\n\n // TODO(cedric): `enhanceMiddleware` is deprecated, but is currently used to unify the middleware stacks\n // See: https://github.com/facebook/metro/commit/22e85fde85ec454792a1b70eba4253747a2587a9\n // See: https://github.com/facebook/metro/commit/d0d554381f119bb80ab09dbd6a1d310b54737e52\n const customEnhanceMiddleware = metroConfig.server.enhanceMiddleware;\n // @ts-expect-error: can't mutate readonly config\n metroConfig.server.enhanceMiddleware = (metroMiddleware: any, server: MetroServer) => {\n if (customEnhanceMiddleware) {\n metroMiddleware = customEnhanceMiddleware(metroMiddleware, server);\n }\n return middleware.use(metroMiddleware);\n };\n\n const devtoolsWebsocketEndpoints = createDevToolsPluginWebsocketEndpoint();\n Object.assign(websocketEndpoints, devtoolsWebsocketEndpoints);\n }\n\n // Attach Expo Atlas if enabled\n await attachAtlasAsync({\n isExporting,\n exp,\n projectRoot,\n middleware,\n metroConfig,\n // NOTE(cedric): reset the Atlas file once, and reuse it for static exports\n resetAtlasFile: isExporting,\n });\n\n const { server, hmrServer, metro } = await runServer(\n metroBundler,\n metroConfig,\n {\n websocketEndpoints,\n watch: !isExporting && isWatchEnabled(),\n },\n {\n mockServer: isExporting,\n }\n );\n\n // Patch transform file to remove inconvenient customTransformOptions which are only used in single well-known files.\n const originalTransformFile = metro\n .getBundler()\n .getBundler()\n .transformFile.bind(metro.getBundler().getBundler());\n\n metro.getBundler().getBundler().transformFile = async function (\n filePath: string,\n transformOptions: TransformOptions,\n fileBuffer?: Buffer\n ) {\n return originalTransformFile(\n filePath,\n pruneCustomTransformOptions(\n filePath,\n // Clone the options so we don't mutate the original.\n {\n ...transformOptions,\n customTransformOptions: {\n __proto__: null,\n ...transformOptions.customTransformOptions,\n },\n }\n ),\n fileBuffer\n );\n };\n\n setEventReporter(eventsSocket.reportMetroEvent);\n\n // This function ensures that modules in source maps are sorted in the same\n // order as in a plain JS bundle.\n metro._getSortedModules = function (this: MetroServer, graph: ReadOnlyGraph) {\n const modules = [...graph.dependencies.values()];\n\n const ctx = {\n platform: graph.transformOptions.platform,\n environment: graph.transformOptions.customTransformOptions?.environment,\n };\n // Assign IDs to modules in a consistent order\n for (const module of modules) {\n // @ts-expect-error\n this._createModuleId(module.path, ctx);\n }\n // Sort by IDs\n return modules.sort(\n // @ts-expect-error\n (a, b) => this._createModuleId(a.path, ctx) - this._createModuleId(b.path, ctx)\n );\n };\n\n if (hmrServer) {\n let hmrJSBundle:\n | typeof import('@expo/metro-config/build/serializer/fork/hmrJSBundle').default\n | typeof import('@expo/metro/metro/DeltaBundler/Serializers/hmrJSBundle').default;\n\n try {\n hmrJSBundle = require('@expo/metro-config/build/serializer/fork/hmrJSBundle').default;\n } catch {\n // TODO: Add fallback for monorepo tests up until the fork is merged.\n Log.warn('Failed to load HMR serializer from @expo/metro-config, using fallback version.');\n hmrJSBundle = require('@expo/metro/metro/DeltaBundler/Serializers/hmrJSBundle');\n }\n\n // Patch HMR Server to send more info to the `_createModuleId` function for deterministic module IDs and add support for serializing HMR updates the same as all other bundles.\n hmrServer._prepareMessage = async function (\n this: MetroHmrServer,\n group,\n options,\n changeEvent\n ) {\n // Fork of https://github.com/facebook/metro/blob/3b3e0aaf725cfa6907bf2c8b5fbc0da352d29efe/packages/metro/src/HmrServer.js#L327-L393\n // with patch for `_createModuleId`.\n const logger = !options.isInitialUpdate ? changeEvent?.logger : null;\n try {\n const revPromise = this._bundler.getRevision(group.revisionId);\n if (!revPromise) {\n return {\n type: 'error',\n body: formatBundlingError(new RevisionNotFoundError(group.revisionId)),\n };\n }\n logger?.point('updateGraph_start');\n const { revision, delta } = await this._bundler.updateGraph(await revPromise, false);\n logger?.point('updateGraph_end');\n this._clientGroups.delete(group.revisionId);\n group.revisionId = revision.id;\n for (const client of group.clients) {\n client.revisionIds = client.revisionIds.filter(\n (revisionId) => revisionId !== group.revisionId\n );\n client.revisionIds.push(revision.id);\n }\n this._clientGroups.set(group.revisionId, group);\n logger?.point('serialize_start');\n // NOTE(EvanBacon): This is the patch\n const moduleIdContext = {\n platform: revision.graph.transformOptions.platform,\n environment: revision.graph.transformOptions.customTransformOptions?.environment,\n };\n const hmrUpdate = hmrJSBundle(delta, revision.graph, {\n clientUrl: group.clientUrl,\n // NOTE(EvanBacon): This is also the patch\n createModuleId: (moduleId: string) => {\n // @ts-expect-error\n return this._createModuleId(moduleId, moduleIdContext);\n },\n includeAsyncPaths: group.graphOptions.lazy,\n projectRoot: this._config.projectRoot,\n serverRoot: this._config.server.unstable_serverRoot ?? this._config.projectRoot,\n });\n logger?.point('serialize_end');\n return {\n type: 'update',\n body: {\n revisionId: revision.id,\n isInitialUpdate: options.isInitialUpdate,\n ...hmrUpdate,\n },\n };\n } catch (error: any) {\n const formattedError = formatBundlingError(error);\n this._config.reporter.update({\n type: 'bundling_error',\n error,\n });\n return {\n type: 'error',\n body: formattedError,\n };\n }\n };\n }\n\n return {\n metro,\n hmrServer,\n server,\n middleware,\n messageSocket: messagesSocket,\n };\n}\n\n// TODO: Fork the entire transform function so we can simply regex the file contents for keywords instead.\nfunction pruneCustomTransformOptions(\n filePath: string,\n transformOptions: TransformOptions\n): TransformOptions {\n // Normalize the filepath for cross platform checking.\n filePath = filePath.split(path.sep).join('/');\n\n if (\n transformOptions.customTransformOptions?.dom &&\n // The only generated file that needs the dom root is `expo/dom/entry.js`\n !filePath.match(/expo\\/dom\\/entry\\.js$/)\n ) {\n // Clear the dom root option if we aren't transforming the magic entry file, this ensures\n // that cached artifacts from other DOM component bundles can be reused.\n transformOptions.customTransformOptions.dom = 'true';\n }\n\n if (\n transformOptions.customTransformOptions?.routerRoot &&\n // The router root is used all over expo-router (`process.env.EXPO_ROUTER_ABS_APP_ROOT`, `process.env.EXPO_ROUTER_APP_ROOT`) so we'll just ignore the entire package.\n !(filePath.match(/\\/expo-router\\/_ctx/) || filePath.match(/\\/expo-router\\/build\\//))\n ) {\n // Set to the default value.\n transformOptions.customTransformOptions.routerRoot = 'app';\n }\n\n if (\n transformOptions.customTransformOptions?.asyncRoutes &&\n // The async routes settings are also used in `expo-router/_ctx.ios.js` (and other platform variants) via `process.env.EXPO_ROUTER_IMPORT_MODE`\n !(filePath.match(/\\/expo-router\\/_ctx/) || filePath.match(/\\/expo-router\\/build\\//))\n ) {\n delete transformOptions.customTransformOptions.asyncRoutes;\n }\n\n if (\n transformOptions.customTransformOptions?.clientBoundaries &&\n // The client boundaries are only used in `expo/virtual/rsc.js` for production RSC exports.\n !filePath.match(/\\/expo\\/virtual\\/rsc\\.js$/)\n ) {\n delete transformOptions.customTransformOptions.clientBoundaries;\n }\n\n return transformOptions;\n}\n\n/**\n * Simplify and communicate if Metro is running without watching file updates,.\n * Exposed for testing.\n */\nexport function isWatchEnabled() {\n if (env.CI) {\n Log.log(\n chalk`Metro is running in CI mode, reloads are disabled. Remove {bold CI=true} to enable watch mode.`\n );\n }\n\n return !env.CI;\n}\n"],"names":["instantiateMetroAsync","isWatchEnabled","loadMetroConfigAsync","LogRespectingTerminal","Terminal","constructor","stream","ttyPrint","sendLog","msg","length","log","format","args","flush","console","info","terminal","process","stdout","projectRoot","options","exp","isExporting","getMetroBundler","config","reportEvent","autolinkingModuleResolutionEnabled","experiments","autolinkingModuleResolution","env","EXPO_USE_STICKY_RESOLVER","serverActionsEnabled","reactServerFunctions","EXPO_UNSTABLE_SERVER_FUNCTIONS","reactServerComponentRoutes","EXPO_USE_METRO_REQUIRE","isReactCanaryEnabled","reactCanary","serverRoot","getMetroServerRoot","terminalReporter","MetroTerminalReporter","configPath","EXPO_OVERRIDE_METRO_CONFIG","undefined","resolvedConfig","resolveConfig","defaultConfig","getDefaultConfig","isEmpty","mergeConfig","resetCache","maxWorkers","server","port","watchFolders","includes","reporter","update","event","globalThis","__requireCycleIgnorePatterns","resolver","requireCycleIgnorePatterns","transformer","publicPath","baseUrl","platformBundlers","getPlatformBundlers","reactCompiler","Log","chalk","gray","EXPO_UNSTABLE_TREE_SHAKING","EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH","CommandError","warn","withMetroMultiPlatformAsync","isTsconfigPathsEnabled","tsconfigPaths","isAutolinkingResolverEnabled","isFastResolverEnabled","EXPO_USE_FAST_RESOLVER","isNamedRequiresEnabled","isReactServerComponentsEnabled","setEventReporter","logger","metroBundler","getConfig","skipSDKVersionRequirement","metroConfig","metro","getBundler","middleware","messagesSocket","eventsSocket","websocketEndpoints","createMetroMiddleware","serverBaseUrl","getUrlCreator","constructUrl","scheme","hostType","prependMiddleware","createCorsMiddleware","debugMiddleware","debugWebsocketEndpoints","createDebugMiddleware","Object","assign","use","createJsInspectorMiddleware","customEnhanceMiddleware","enhanceMiddleware","metroMiddleware","devtoolsWebsocketEndpoints","createDevToolsPluginWebsocketEndpoint","attachAtlasAsync","resetAtlasFile","hmrServer","runServer","watch","mockServer","originalTransformFile","transformFile","bind","filePath","transformOptions","fileBuffer","pruneCustomTransformOptions","customTransformOptions","__proto__","reportMetroEvent","_getSortedModules","graph","modules","dependencies","values","ctx","platform","environment","module","_createModuleId","path","sort","a","b","hmrJSBundle","require","default","_prepareMessage","group","changeEvent","isInitialUpdate","revision","revPromise","_bundler","getRevision","revisionId","type","body","formatBundlingError","RevisionNotFoundError","point","delta","updateGraph","_clientGroups","delete","id","client","clients","revisionIds","filter","push","set","moduleIdContext","hmrUpdate","clientUrl","createModuleId","moduleId","includeAsyncPaths","graphOptions","lazy","_config","unstable_serverRoot","error","formattedError","messageSocket","split","sep","join","dom","match","routerRoot","asyncRoutes","clientBoundaries","CI"],"mappings":";;;;;;;;;;;IA+MsBA,qBAAqB;eAArBA;;IA6RNC,cAAc;eAAdA;;IAvaMC,oBAAoB;eAApBA;;;;yBArEqB;;;;;;;yBACR;;;;;;;gEAMD;;;;;;;gEAEF;;;;;;;yBACyB;;;;;;;yBAChC;;;;;;;yBACQ;;;;;;;gEACf;;;;;;;gEAED;;;;;;iDAEqC;uCAEhB;6BACL;uCACK;uCACA;+BACZ;wCACkB;qBACxB;qBACA;wBACS;gCACQ;6CACO;2BACV;kCACE;;;;;;AAOpC,uGAAuG;AACvG,MAAMC,8BAA8BC,qBAAQ;IAC1CC,YAAYC,MAAkE,CAAE;QAC9E,KAAK,CAACA,QAAQ;YAAEC,UAAU;QAAK;QAE/B,MAAMC,UAAU,CAAC,GAAGC;YAClB,IAAI,CAACA,IAAIC,MAAM,EAAE;gBACf,IAAI,CAACC,GAAG,CAAC;YACX,OAAO;gBACL,MAAM,CAACC,QAAQ,GAAGC,KAAK,GAAGJ;gBAC1B,IAAI,CAACE,GAAG,CAACC,WAAWC;YACtB;YACA,6FAA6F;YAC7F,IAAI,CAACC,KAAK;QACZ;QAEAC,QAAQJ,GAAG,GAAGH;QACdO,QAAQC,IAAI,GAAGR;IACjB;AACF;AAEA,6DAA6D;AAC7D,MAAMS,WAAW,IAAId,sBAAsBe,QAAQC,MAAM;AASlD,eAAejB,qBACpBkB,WAAmB,EACnBC,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;QACzF,wEAAwE;QACxEjE,iBAAiBG,sBAAsB,CAAC6D,GAAG,GAAG;IAChD;IAEA,IACEhE,EAAAA,4CAAAA,iBAAiBG,sBAAsB,qBAAvCH,0CAAyCkE,UAAU,KACnD,qKAAqK;IACrK,CAAEnE,CAAAA,SAASkE,KAAK,CAAC,0BAA0BlE,SAASkE,KAAK,CAAC,yBAAwB,GAClF;QACA,4BAA4B;QAC5BjE,iBAAiBG,sBAAsB,CAAC+D,UAAU,GAAG;IACvD;IAEA,IACElE,EAAAA,4CAAAA,iBAAiBG,sBAAsB,qBAAvCH,0CAAyCmE,WAAW,KACpD,+IAA+I;IAC/I,CAAEpE,CAAAA,SAASkE,KAAK,CAAC,0BAA0BlE,SAASkE,KAAK,CAAC,yBAAwB,GAClF;QACA,OAAOjE,iBAAiBG,sBAAsB,CAACgE,WAAW;IAC5D;IAEA,IACEnE,EAAAA,4CAAAA,iBAAiBG,sBAAsB,qBAAvCH,0CAAyCoE,gBAAgB,KACzD,2FAA2F;IAC3F,CAACrE,SAASkE,KAAK,CAAC,8BAChB;QACA,OAAOjE,iBAAiBG,sBAAsB,CAACiE,gBAAgB;IACjE;IAEA,OAAOpE;AACT;AAMO,SAAS/H;IACd,IAAI6B,QAAG,CAACuK,EAAE,EAAE;QACV9H,QAAG,CAAC5D,GAAG,CACL6D,IAAAA,gBAAK,CAAA,CAAC,8FAA8F,CAAC;IAEzG;IAEA,OAAO,CAAC1C,QAAG,CAACuK,EAAE;AAChB"} \ No newline at end of file diff --git a/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/utils/telemetry/clients/FetchClient.js b/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/utils/telemetry/clients/FetchClient.js index 86156266..3768cfd9 100644 --- a/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/utils/telemetry/clients/FetchClient.js +++ b/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/utils/telemetry/clients/FetchClient.js @@ -33,7 +33,7 @@ class FetchClient { this.headers = { accept: 'application/json', 'content-type': 'application/json', - 'user-agent': `expo-cli/${"54.0.22"}`, + 'user-agent': `expo-cli/${"54.0.23"}`, authorization: 'Basic ' + _nodebuffer().Buffer.from(`${target}:`).toString('base64') }; } diff --git a/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/utils/telemetry/utils/context.js b/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/utils/telemetry/utils/context.js index f71d677d..35e90dc5 100644 --- a/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/utils/telemetry/utils/context.js +++ b/frontend-admin/node_modules/expo/node_modules/@expo/cli/build/src/utils/telemetry/utils/context.js @@ -83,7 +83,7 @@ function createContext() { cpu: summarizeCpuInfo(), app: { name: 'expo/cli', - version: "54.0.22" + version: "54.0.23" }, ci: _ciinfo().isCI ? { name: _ciinfo().name, diff --git a/frontend-admin/node_modules/expo/node_modules/@expo/cli/package.json b/frontend-admin/node_modules/expo/node_modules/@expo/cli/package.json index 50da8f62..e221fe34 100644 --- a/frontend-admin/node_modules/expo/node_modules/@expo/cli/package.json +++ b/frontend-admin/node_modules/expo/node_modules/@expo/cli/package.json @@ -1,6 +1,6 @@ { "name": "@expo/cli", - "version": "54.0.22", + "version": "54.0.23", "description": "The Expo CLI", "main": "build/bin/cli", "bin": { @@ -169,5 +169,5 @@ "tree-kill": "^1.2.2", "tsd": "^0.28.1" }, - "gitHead": "5205083d153ffa0c5e48db969aeaa1f9810453fc" + "gitHead": "cfd65241fb73317b63e6736e7890a784a69940fc" } diff --git a/frontend-admin/node_modules/expo/node_modules/semver/README.md b/frontend-admin/node_modules/expo/node_modules/semver/README.md index e9522153..e9d1bc5e 100644 --- a/frontend-admin/node_modules/expo/node_modules/semver/README.md +++ b/frontend-admin/node_modules/expo/node_modules/semver/README.md @@ -110,8 +110,9 @@ Options: -l --loose Interpret versions and ranges loosely --n <0|1> - This is the base to be used for the prerelease identifier. +-n <0|1|false> + Base number for prerelease identifier (default: 0). + Use false to omit the number altogether. -p --include-prerelease Always include prerelease versions in range matching diff --git a/frontend-admin/node_modules/expo/node_modules/semver/bin/semver.js b/frontend-admin/node_modules/expo/node_modules/semver/bin/semver.js index dbb1bf53..d62bfc0e 100755 --- a/frontend-admin/node_modules/expo/node_modules/semver/bin/semver.js +++ b/frontend-admin/node_modules/expo/node_modules/semver/bin/semver.js @@ -105,7 +105,7 @@ const main = () => { versions = versions.map((v) => { return coerce ? (semver.coerce(v, options) || { version: v }).version : v }).filter((v) => { - return semver.valid(v) + return semver.valid(v, options) }) if (!versions.length) { return fail() diff --git a/frontend-admin/node_modules/expo/node_modules/semver/functions/diff.js b/frontend-admin/node_modules/expo/node_modules/semver/functions/diff.js index 04e064e9..c99ab51c 100644 --- a/frontend-admin/node_modules/expo/node_modules/semver/functions/diff.js +++ b/frontend-admin/node_modules/expo/node_modules/semver/functions/diff.js @@ -53,7 +53,7 @@ const diff = (version1, version2) => { return prefix + 'patch' } - // high and low are preleases + // high and low are prereleases return 'prerelease' } diff --git a/frontend-admin/node_modules/expo/node_modules/semver/internal/re.js b/frontend-admin/node_modules/expo/node_modules/semver/internal/re.js index 4758c58d..639fca89 100644 --- a/frontend-admin/node_modules/expo/node_modules/semver/internal/re.js +++ b/frontend-admin/node_modules/expo/node_modules/semver/internal/re.js @@ -78,8 +78,8 @@ createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. -// Non-numberic identifiers include numberic identifiers but can be longer. -// Therefore non-numberic identifiers must go first. +// Non-numeric identifiers include numeric identifiers but can be longer. +// Therefore non-numeric identifiers must go first. createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER] }|${src[t.NUMERICIDENTIFIER]})`) diff --git a/frontend-admin/node_modules/expo/node_modules/semver/package.json b/frontend-admin/node_modules/expo/node_modules/semver/package.json index 2b8cadaa..a84de916 100644 --- a/frontend-admin/node_modules/expo/node_modules/semver/package.json +++ b/frontend-admin/node_modules/expo/node_modules/semver/package.json @@ -1,6 +1,6 @@ { "name": "semver", - "version": "7.7.3", + "version": "7.7.4", "description": "The semantic version parser used by npm.", "main": "index.js", "scripts": { @@ -14,8 +14,8 @@ "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" }, "devDependencies": { - "@npmcli/eslint-config": "^5.0.0", - "@npmcli/template-oss": "4.25.1", + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.29.0", "benchmark": "^2.1.4", "tap": "^16.0.0" }, @@ -52,7 +52,7 @@ "author": "GitHub Inc.", "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.25.1", + "version": "4.29.0", "engines": ">=10", "distPaths": [ "classes/", diff --git a/frontend-admin/node_modules/expo/node_modules/semver/ranges/subset.js b/frontend-admin/node_modules/expo/node_modules/semver/ranges/subset.js index 2c49aef1..99f43218 100644 --- a/frontend-admin/node_modules/expo/node_modules/semver/ranges/subset.js +++ b/frontend-admin/node_modules/expo/node_modules/semver/ranges/subset.js @@ -38,7 +38,7 @@ const compare = require('../functions/compare.js') // - If LT // - If LT.semver is greater than any < or <= comp in C, return false // - If LT is <=, and LT.semver does not satisfy every C, return false -// - If GT.semver has a prerelease, and not in prerelease mode +// - If LT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the LT.semver tuple, return false // - Else return true diff --git a/frontend-admin/node_modules/expo/package.json b/frontend-admin/node_modules/expo/package.json index 7e9ba2bb..75862ed4 100644 --- a/frontend-admin/node_modules/expo/package.json +++ b/frontend-admin/node_modules/expo/package.json @@ -1,6 +1,6 @@ { "name": "expo", - "version": "54.0.32", + "version": "54.0.33", "description": "The Expo SDK", "main": "src/Expo.ts", "module": "src/Expo.ts", @@ -75,7 +75,7 @@ "homepage": "https://github.com/expo/expo/tree/main/packages/expo", "dependencies": { "@babel/runtime": "^7.20.0", - "@expo/cli": "54.0.22", + "@expo/cli": "54.0.23", "@expo/config": "~12.0.13", "@expo/config-plugins": "~54.0.4", "@expo/devtools": "0.1.8", @@ -124,5 +124,5 @@ "optional": true } }, - "gitHead": "5205083d153ffa0c5e48db969aeaa1f9810453fc" + "gitHead": "cfd65241fb73317b63e6736e7890a784a69940fc" } diff --git a/frontend-admin/node_modules/expo/template.tgz b/frontend-admin/node_modules/expo/template.tgz index e2c32154..b97150ec 100644 Binary files a/frontend-admin/node_modules/expo/template.tgz and b/frontend-admin/node_modules/expo/template.tgz differ diff --git a/frontend-admin/node_modules/npm-package-arg/node_modules/semver/README.md b/frontend-admin/node_modules/npm-package-arg/node_modules/semver/README.md index e9522153..e9d1bc5e 100644 --- a/frontend-admin/node_modules/npm-package-arg/node_modules/semver/README.md +++ b/frontend-admin/node_modules/npm-package-arg/node_modules/semver/README.md @@ -110,8 +110,9 @@ Options: -l --loose Interpret versions and ranges loosely --n <0|1> - This is the base to be used for the prerelease identifier. +-n <0|1|false> + Base number for prerelease identifier (default: 0). + Use false to omit the number altogether. -p --include-prerelease Always include prerelease versions in range matching diff --git a/frontend-admin/node_modules/npm-package-arg/node_modules/semver/bin/semver.js b/frontend-admin/node_modules/npm-package-arg/node_modules/semver/bin/semver.js index dbb1bf53..d62bfc0e 100755 --- a/frontend-admin/node_modules/npm-package-arg/node_modules/semver/bin/semver.js +++ b/frontend-admin/node_modules/npm-package-arg/node_modules/semver/bin/semver.js @@ -105,7 +105,7 @@ const main = () => { versions = versions.map((v) => { return coerce ? (semver.coerce(v, options) || { version: v }).version : v }).filter((v) => { - return semver.valid(v) + return semver.valid(v, options) }) if (!versions.length) { return fail() diff --git a/frontend-admin/node_modules/npm-package-arg/node_modules/semver/functions/diff.js b/frontend-admin/node_modules/npm-package-arg/node_modules/semver/functions/diff.js index 04e064e9..c99ab51c 100644 --- a/frontend-admin/node_modules/npm-package-arg/node_modules/semver/functions/diff.js +++ b/frontend-admin/node_modules/npm-package-arg/node_modules/semver/functions/diff.js @@ -53,7 +53,7 @@ const diff = (version1, version2) => { return prefix + 'patch' } - // high and low are preleases + // high and low are prereleases return 'prerelease' } diff --git a/frontend-admin/node_modules/npm-package-arg/node_modules/semver/internal/re.js b/frontend-admin/node_modules/npm-package-arg/node_modules/semver/internal/re.js index 4758c58d..639fca89 100644 --- a/frontend-admin/node_modules/npm-package-arg/node_modules/semver/internal/re.js +++ b/frontend-admin/node_modules/npm-package-arg/node_modules/semver/internal/re.js @@ -78,8 +78,8 @@ createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. -// Non-numberic identifiers include numberic identifiers but can be longer. -// Therefore non-numberic identifiers must go first. +// Non-numeric identifiers include numeric identifiers but can be longer. +// Therefore non-numeric identifiers must go first. createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER] }|${src[t.NUMERICIDENTIFIER]})`) diff --git a/frontend-admin/node_modules/npm-package-arg/node_modules/semver/package.json b/frontend-admin/node_modules/npm-package-arg/node_modules/semver/package.json index 2b8cadaa..a84de916 100644 --- a/frontend-admin/node_modules/npm-package-arg/node_modules/semver/package.json +++ b/frontend-admin/node_modules/npm-package-arg/node_modules/semver/package.json @@ -1,6 +1,6 @@ { "name": "semver", - "version": "7.7.3", + "version": "7.7.4", "description": "The semantic version parser used by npm.", "main": "index.js", "scripts": { @@ -14,8 +14,8 @@ "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" }, "devDependencies": { - "@npmcli/eslint-config": "^5.0.0", - "@npmcli/template-oss": "4.25.1", + "@npmcli/eslint-config": "^6.0.0", + "@npmcli/template-oss": "4.29.0", "benchmark": "^2.1.4", "tap": "^16.0.0" }, @@ -52,7 +52,7 @@ "author": "GitHub Inc.", "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.25.1", + "version": "4.29.0", "engines": ">=10", "distPaths": [ "classes/", diff --git a/frontend-admin/node_modules/npm-package-arg/node_modules/semver/ranges/subset.js b/frontend-admin/node_modules/npm-package-arg/node_modules/semver/ranges/subset.js index 2c49aef1..99f43218 100644 --- a/frontend-admin/node_modules/npm-package-arg/node_modules/semver/ranges/subset.js +++ b/frontend-admin/node_modules/npm-package-arg/node_modules/semver/ranges/subset.js @@ -38,7 +38,7 @@ const compare = require('../functions/compare.js') // - If LT // - If LT.semver is greater than any < or <= comp in C, return false // - If LT is <=, and LT.semver does not satisfy every C, return false -// - If GT.semver has a prerelease, and not in prerelease mode +// - If LT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the LT.semver tuple, return false // - Else return true diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/AnimationFrameQueue/AnimationFrameBatchinator.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/AnimationFrameQueue/AnimationFrameBatchinator.cpp index 2784e445..17da8002 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/AnimationFrameQueue/AnimationFrameBatchinator.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/AnimationFrameQueue/AnimationFrameBatchinator.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include @@ -12,22 +11,26 @@ namespace worklets { -void AnimationFrameBatchinator::addToBatch(jsi::Function &&callback) { +void AnimationFrameBatchinator::addToBatch( + const facebook::jsi::Value &callback) { { std::lock_guard lock(callbacksMutex_); - callbacks_.push_back(std::make_shared(std::move(callback))); + callbacks_.push_back( + std::make_shared(*uiRuntime_, callback)); } flush(); } -AnimationFrameBatchinator::JsiRequestAnimationFrame AnimationFrameBatchinator::getJsiRequestAnimationFrame() { - return [weakThis = weak_from_this()](facebook::jsi::Runtime &rt, const facebook::jsi::Value &callback) { +AnimationFrameBatchinator::JsiRequestAnimationFrame +AnimationFrameBatchinator::getJsiRequestAnimationFrame() { + return [weakThis = weak_from_this()]( + facebook::jsi::Runtime &rt, const facebook::jsi::Value &callback) { const auto strongThis = weakThis.lock(); if (!strongThis) { return; } - strongThis->addToBatch(callback.asObject(rt).asFunction(rt)); + strongThis->addToBatch(callback); }; } @@ -45,21 +48,24 @@ void AnimationFrameBatchinator::flush() { auto callbacks = strongThis->pullCallbacks(); strongThis->flushRequested_ = false; - auto &uiWorkletRuntime = strongThis->uiWorkletRuntime_; + auto &uiRuntime = *(strongThis->uiRuntime_); for (const auto &callback : callbacks) { - uiWorkletRuntime->runSync(*callback, timestampMs); + runOnRuntimeGuarded(uiRuntime, *callback, timestampMs); } }); } -std::vector> AnimationFrameBatchinator::pullCallbacks() { +std::vector> +AnimationFrameBatchinator::pullCallbacks() { std::lock_guard lock(callbacksMutex_); return std::move(callbacks_); } AnimationFrameBatchinator::AnimationFrameBatchinator( - const std::shared_ptr &uiWorkletRuntime, - RuntimeBindings::RequestAnimationFrame requestAnimationFrame) - : uiWorkletRuntime_(uiWorkletRuntime), requestAnimationFrame_(std::move(requestAnimationFrame)) {} + facebook::jsi::Runtime &uiRuntime, + std::function)> + &&forwardedRequestAnimationFrame) + : uiRuntime_(&uiRuntime), + requestAnimationFrame_(std::move(forwardedRequestAnimationFrame)) {} } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/AnimationFrameQueue/AnimationFrameBatchinator.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/AnimationFrameQueue/AnimationFrameBatchinator.h index edb2249e..c6455b0c 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/AnimationFrameQueue/AnimationFrameBatchinator.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/AnimationFrameQueue/AnimationFrameBatchinator.h @@ -2,9 +2,6 @@ #include #include -#include -#include - #include #include #include @@ -13,25 +10,28 @@ namespace worklets { -class AnimationFrameBatchinator : public std::enable_shared_from_this { +class AnimationFrameBatchinator + : public std::enable_shared_from_this { public: - using JsiRequestAnimationFrame = std::function; + using JsiRequestAnimationFrame = std::function< + void(facebook::jsi::Runtime &, const facebook::jsi::Value &)>; - void addToBatch(jsi::Function &&callback); + void addToBatch(const facebook::jsi::Value &callback); JsiRequestAnimationFrame getJsiRequestAnimationFrame(); AnimationFrameBatchinator( - const std::shared_ptr &uiWorkletRuntime, - RuntimeBindings::RequestAnimationFrame requestAnimationFrame); + facebook::jsi::Runtime &uiRuntime, + std::function)> + &&forwardedRequestAnimationFrame); private: void flush(); - std::vector> pullCallbacks(); + std::vector> pullCallbacks(); - std::vector> callbacks_{}; + std::vector> callbacks_{}; std::mutex callbacksMutex_{}; std::atomic_bool flushRequested_{}; - std::shared_ptr uiWorkletRuntime_; + facebook::jsi::Runtime *uiRuntime_; std::function)> requestAnimationFrame_; }; diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.cpp index a7cb25dd..15f5ad2a 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.cpp @@ -14,10 +14,7 @@ #include #endif // __ANDROID__ -#include -#include #include -#include using namespace facebook; @@ -50,7 +47,7 @@ inline void scheduleOnUI( const auto scope = jsi::Scope(uiWorkletRuntime->getJSIRuntime()); #endif // JS_RUNTIME_HERMES - uiWorkletRuntime->runSync(serializableWorklet); + uiWorkletRuntime->runGuarded(serializableWorklet); }); } @@ -59,10 +56,7 @@ inline jsi::Value executeOnUIRuntimeSync( jsi::Runtime &rt, const jsi::Value &worklet) { if (auto uiWorkletRuntime = weakUIWorkletRuntime.lock()) { - auto serializableWorklet = extractSerializableOrThrow( - rt, worklet, "[Worklets] Only worklets can be executed on UI runtime."); - auto serializedResult = uiWorkletRuntime->runSyncSerialized(serializableWorklet); - return serializedResult->toJSValue(rt); + return uiWorkletRuntime->executeSync(rt, worklet); } return jsi::Value::undefined(); } @@ -76,8 +70,8 @@ inline jsi::Value createWorkletRuntime( std::shared_ptr &initializer, const std::shared_ptr &queue, bool enableEventLoop) { - const auto workletRuntime = - runtimeManager->createWorkletRuntime(std::move(jsiWorkletsModuleProxy), name, initializer, queue); + const auto workletRuntime = runtimeManager->createWorkletRuntime( + jsiWorkletsModuleProxy, name, initializer, queue); return jsi::Object::createFromHostObject(originRuntime, workletRuntime); } @@ -89,9 +83,10 @@ inline jsi::Value propagateModuleUpdate( const auto runtimes = runtimeManager->getAllRuntimes(); for (auto runtime : runtimes) { - runtime->runSync([code, sourceUrl](jsi::Runtime &rt) -> void { + runtime->executeSync([code, sourceUrl](jsi::Runtime &rt) { const auto buffer = std::make_shared(code); rt.evaluateJavaScript(buffer, sourceUrl); + return jsi::Value::undefined(); }); } return jsi::Value::undefined(); @@ -105,11 +100,18 @@ inline jsi::Value reportFatalErrorOnJS( const std::string &name, const std::string &jsEngine) { JSLogger::reportFatalErrorOnJS( - jsScheduler, JSErrorData{.message = message, .stack = stack, .name = name, .jsEngine = jsEngine}); + jsScheduler, + JSErrorData{ + .message = message, + .stack = stack, + .name = name, + .jsEngine = jsEngine}); return jsi::Value::undefined(); } -inline std::shared_ptr extractAsyncQueue(jsi::Runtime &rt, const jsi::Value &value) { +inline std::shared_ptr extractAsyncQueue( + jsi::Runtime &rt, + const jsi::Value &value) { if (!value.isObject()) { return nullptr; } @@ -125,33 +127,13 @@ inline std::shared_ptr extractAsyncQueue(jsi::Runtime &rt, const jsi return asyncQueue; } -inline void registerCustomSerializable( - const std::shared_ptr &runtimeManager, - const std::shared_ptr &memoryManager, - const std::shared_ptr &determine, - const std::shared_ptr &pack, - const std::shared_ptr &unpack, - const int typeId) { - const SerializationData data{.determine = determine, .pack = pack, .unpack = unpack, .typeId = typeId}; - // Prevent registering new worklet runtimes while we are updating existing ones to prevent inconsistencies. - runtimeManager->pause(); - - memoryManager->registerCustomSerializable(data); - for (const auto &runtime : runtimeManager->getAllRuntimes()) { - memoryManager->loadCustomSerializable(runtime, data); - } - - runtimeManager->resume(); -} - JSIWorkletsModuleProxy::JSIWorkletsModuleProxy( const bool isDevBundle, - const std::shared_ptr &script, + const std::shared_ptr &script, const std::string &sourceUrl, const std::shared_ptr &jsQueue, const std::shared_ptr &jsScheduler, const std::shared_ptr &uiScheduler, - const std::shared_ptr &memoryManager, const std::shared_ptr &runtimeManager, const std::weak_ptr &uiWorkletRuntime) : jsi::HostObject(), @@ -161,11 +143,11 @@ JSIWorkletsModuleProxy::JSIWorkletsModuleProxy( jsQueue_(jsQueue), jsScheduler_(jsScheduler), uiScheduler_(uiScheduler), - memoryManager_(memoryManager), runtimeManager_(runtimeManager), uiWorkletRuntime_(uiWorkletRuntime) {} -JSIWorkletsModuleProxy::JSIWorkletsModuleProxy(const JSIWorkletsModuleProxy &other) +JSIWorkletsModuleProxy::JSIWorkletsModuleProxy( + const JSIWorkletsModuleProxy &other) : jsi::HostObject(), isDevBundle_(other.isDevBundle_), script_(other.script_), @@ -173,203 +155,315 @@ JSIWorkletsModuleProxy::JSIWorkletsModuleProxy(const JSIWorkletsModuleProxy &oth jsQueue_(other.jsQueue_), jsScheduler_(other.jsScheduler_), uiScheduler_(other.uiScheduler_), - memoryManager_(other.memoryManager_), runtimeManager_(other.runtimeManager_), uiWorkletRuntime_(other.uiWorkletRuntime_) {} JSIWorkletsModuleProxy::~JSIWorkletsModuleProxy() = default; -std::vector JSIWorkletsModuleProxy::getPropertyNames(jsi::Runtime &rt) { +std::vector JSIWorkletsModuleProxy::getPropertyNames( + jsi::Runtime &rt) { std::vector propertyNames; - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializable")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableBigInt")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableBoolean")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableImport")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableNull")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableNumber")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableString")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableUndefined")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableHostObject")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableInitializer")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableArray")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableFunction")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableTurboModuleLike")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableObject")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableMap")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableSet")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSerializableWorklet")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createCustomSerializable")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "registerCustomSerializable")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializable")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableBigInt")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableBoolean")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableImport")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableNull")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableNumber")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableString")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableUndefined")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableHostObject")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableInitializer")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableArray")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableFunction")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableTurboModuleLike")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableObject")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableMap")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableSet")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSerializableWorklet")); propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "scheduleOnUI")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "executeOnUIRuntimeSync")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createWorkletRuntime")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "scheduleOnRuntime")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "reportFatalErrorOnJS")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "executeOnUIRuntimeSync")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createWorkletRuntime")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "scheduleOnRuntime")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "reportFatalErrorOnJS")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "getStaticFeatureFlag")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "setDynamicFeatureFlag")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "getStaticFeatureFlag")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "setDynamicFeatureFlag")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "createSynchronizable")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "synchronizableGetDirty")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "synchronizableGetBlocking")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "synchronizableSetBlocking")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "synchronizableLock")); - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "synchronizableUnlock")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "createSynchronizable")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "synchronizableGetDirty")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "synchronizableGetBlocking")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "synchronizableSetBlocking")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "synchronizableLock")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "synchronizableUnlock")); #ifdef WORKLETS_BUNDLE_MODE - propertyNames.emplace_back(jsi::PropNameID::forAscii(rt, "propagateModuleUpdate")); + propertyNames.emplace_back( + jsi::PropNameID::forAscii(rt, "propagateModuleUpdate")); #endif // WORKLETS_BUNDLE_MODE return propertyNames; } -jsi::Value JSIWorkletsModuleProxy::get(jsi::Runtime &rt, const jsi::PropNameID &propName) { +jsi::Value JSIWorkletsModuleProxy::get( + jsi::Runtime &rt, + const jsi::PropNameID &propName) { const auto name = propName.utf8(rt); if (name == "createSerializable") { return jsi::Function::createFromHostFunction( - rt, propName, 3, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + rt, + propName, + 3, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { return makeSerializableClone(rt, args[0], args[1], args[2]); }); } if (name == "createSerializableBigInt") { return jsi::Function::createFromHostFunction( - rt, propName, 1, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + rt, + propName, + 1, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { return makeSerializableBigInt(rt, args[0].asBigInt(rt)); }); } if (name == "createSerializableBoolean") { return jsi::Function::createFromHostFunction( - rt, propName, 1, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + rt, + propName, + 1, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { return makeSerializableBoolean(rt, args[0].asBool()); }); } if (name == "createSerializableImport") { return jsi::Function::createFromHostFunction( - rt, propName, 2, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { - return makeSerializableImport(rt, args[0].asNumber(), args[1].asString(rt)); + rt, + propName, + 2, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { + return makeSerializableImport( + rt, args[0].asNumber(), args[1].asString(rt)); }); } if (name == "createSerializableNumber") { return jsi::Function::createFromHostFunction( - rt, propName, 1, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + rt, + propName, + 1, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { return makeSerializableNumber(rt, args[0].asNumber()); }); } if (name == "createSerializableNull") { return jsi::Function::createFromHostFunction( - rt, propName, 0, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { - return makeSerializableNull(rt); - }); + rt, + propName, + 0, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { return makeSerializableNull(rt); }); } if (name == "createSerializableString") { return jsi::Function::createFromHostFunction( - rt, propName, 1, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + rt, + propName, + 1, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { return makeSerializableString(rt, args[0].asString(rt)); }); } if (name == "createSerializableUndefined") { return jsi::Function::createFromHostFunction( - rt, propName, 0, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { - return makeSerializableUndefined(rt); - }); + rt, + propName, + 0, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { return makeSerializableUndefined(rt); }); } if (name == "createSerializableInitializer") { return jsi::Function::createFromHostFunction( - rt, propName, 1, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + rt, + propName, + 1, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { return makeSerializableInitializer(rt, args[0].asObject(rt)); }); } if (name == "createSerializableArray") { return jsi::Function::createFromHostFunction( - rt, propName, 2, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { - return makeSerializableArray(rt, args[0].asObject(rt).asArray(rt), args[1]); + rt, + propName, + 2, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { + return makeSerializableArray( + rt, args[0].asObject(rt).asArray(rt), args[1]); }); } if (name == "createSerializableMap") { return jsi::Function::createFromHostFunction( - rt, propName, 2, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { - return makeSerializableMap(rt, args[0].asObject(rt).asArray(rt), args[1].asObject(rt).asArray(rt)); + rt, + propName, + 2, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { + return makeSerializableMap( + rt, + args[0].asObject(rt).asArray(rt), + args[1].asObject(rt).asArray(rt)); }); } if (name == "createSerializableSet") { return jsi::Function::createFromHostFunction( - rt, propName, 1, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + rt, + propName, + 1, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { return makeSerializableSet(rt, args[0].asObject(rt).asArray(rt)); }); } if (name == "createSerializableHostObject") { return jsi::Function::createFromHostFunction( - rt, propName, 1, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { - return makeSerializableHostObject(rt, args[0].asObject(rt).asHostObject(rt)); + rt, + propName, + 1, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { + return makeSerializableHostObject( + rt, args[0].asObject(rt).asHostObject(rt)); }); } if (name == "createSerializableFunction") { return jsi::Function::createFromHostFunction( - rt, propName, 1, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { - return makeSerializableFunction(rt, args[0].asObject(rt).asFunction(rt)); + rt, + propName, + 1, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { + return makeSerializableFunction( + rt, args[0].asObject(rt).asFunction(rt)); }); } if (name == "createSerializableTurboModuleLike") { return jsi::Function::createFromHostFunction( - rt, propName, 2, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { - return makeSerializableTurboModuleLike(rt, args[0].asObject(rt), args[1].asObject(rt).asHostObject(rt)); + rt, + propName, + 2, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { + return makeSerializableTurboModuleLike( + rt, args[0].asObject(rt), args[1].asObject(rt).asHostObject(rt)); }); } if (name == "createSerializableObject") { return jsi::Function::createFromHostFunction( - rt, propName, 1, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { - return makeSerializableObject(rt, args[0].getObject(rt), args[1].getBool(), args[2]); + rt, + propName, + 1, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { + return makeSerializableObject( + rt, args[0].getObject(rt), args[1].getBool(), args[2]); }); } if (name == "createSerializableWorklet") { - return jsi::Function::createFromHostFunction( - rt, propName, 2, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { - return makeSerializableWorklet(rt, args[0].getObject(rt), args[1].getBool()); - }); - } - - if (name == "createCustomSerializable") { - return jsi::Function::createFromHostFunction( - rt, propName, 2, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { - return makeCustomSerializable(rt, args[0], args[1].asNumber()); - }); - } - - if (name == "registerCustomSerializable") { return jsi::Function::createFromHostFunction( rt, propName, - 4, - [memoryManager = memoryManager_, runtimeManager = runtimeManager_]( - jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { - const auto determine = extractSerializableOrThrow( - rt, args[0], "[Worklets] Determine function must be a worklet."); - const auto pack = extractSerializableOrThrow( - rt, args[1], "[Worklets] Pack function must be a worklet."); - const auto unpack = extractSerializableOrThrow( - rt, args[2], "[Worklets] Unpack function must be a worklet."); - const auto typeId = args[3].asNumber(); - registerCustomSerializable(runtimeManager, memoryManager, determine, pack, unpack, typeId); - return jsi::Value::undefined(); + 2, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { + return makeSerializableWorklet( + rt, args[0].getObject(rt), args[1].getBool()); }); } @@ -379,7 +473,10 @@ jsi::Value JSIWorkletsModuleProxy::get(jsi::Runtime &rt, const jsi::PropNameID & propName, 1, [uiScheduler = uiScheduler_, uiWorkletRuntime = uiWorkletRuntime_]( - jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { scheduleOnUI(uiScheduler, uiWorkletRuntime, rt, args[0]); return jsi::Value::undefined(); }); @@ -391,7 +488,10 @@ jsi::Value JSIWorkletsModuleProxy::get(jsi::Runtime &rt, const jsi::PropNameID & propName, 1, [uiWorkletRuntime = uiWorkletRuntime_]( - jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { return executeOnUIRuntimeSync(uiWorkletRuntime, rt, args[0]); }); } @@ -402,10 +502,14 @@ jsi::Value JSIWorkletsModuleProxy::get(jsi::Runtime &rt, const jsi::PropNameID & propName, 5, [clone = std::make_shared(*this)]( - jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { const auto name = args[0].asString(rt).utf8(rt); auto serializableInitializer = - extractSerializableOrThrow(rt, args[1], "[Worklets] Initializer must be a worklet."); + extractSerializableOrThrow( + rt, args[1], "[Worklets] Initializer must be a worklet."); const auto useDefaultQueue = args[2].asBool(); std::shared_ptr asyncQueue; @@ -431,7 +535,13 @@ jsi::Value JSIWorkletsModuleProxy::get(jsi::Runtime &rt, const jsi::PropNameID & if (name == "scheduleOnRuntime") { return jsi::Function::createFromHostFunction( - rt, propName, 2, [](jsi::Runtime &rt, const jsi ::Value &thisValue, const jsi::Value *args, size_t count) { + rt, + propName, + 2, + [](jsi::Runtime &rt, + const jsi ::Value &thisValue, + const jsi::Value *args, + size_t count) { worklets::scheduleOnRuntime(rt, args[0], args[1]); return jsi::Value::undefined(); }); @@ -443,7 +553,10 @@ jsi::Value JSIWorkletsModuleProxy::get(jsi::Runtime &rt, const jsi::PropNameID & propName, 4, [jsScheduler = jsScheduler_]( - jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { return reportFatalErrorOnJS( jsScheduler, /* message */ args[0].asString(rt).utf8(rt), @@ -455,8 +568,15 @@ jsi::Value JSIWorkletsModuleProxy::get(jsi::Runtime &rt, const jsi::PropNameID & if (name == "createSynchronizable") { return jsi::Function::createFromHostFunction( - rt, propName, 1, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { - auto initial = extractSerializableOrThrow(rt, args[0], "[Worklets] Value must be a Serializable."); + rt, + propName, + 1, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { + auto initial = extractSerializableOrThrow( + rt, args[0], "[Worklets] Value must be a Serializable."); auto synchronizable = std::make_shared(initial); return SerializableJSRef::newNativeStateObject(rt, synchronizable); }); @@ -464,7 +584,13 @@ jsi::Value JSIWorkletsModuleProxy::get(jsi::Runtime &rt, const jsi::PropNameID & if (name == "synchronizableGetDirty") { return jsi::Function::createFromHostFunction( - rt, propName, 1, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + rt, + propName, + 1, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { auto synchronizable = extractSynchronizableOrThrow(rt, args[0]); return synchronizable->getDirty()->toJSValue(rt); }); @@ -472,7 +598,13 @@ jsi::Value JSIWorkletsModuleProxy::get(jsi::Runtime &rt, const jsi::PropNameID & if (name == "synchronizableGetBlocking") { return jsi::Function::createFromHostFunction( - rt, propName, 1, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + rt, + propName, + 1, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { auto synchronizable = extractSynchronizableOrThrow(rt, args[0]); return synchronizable->getBlocking()->toJSValue(rt); }); @@ -480,17 +612,30 @@ jsi::Value JSIWorkletsModuleProxy::get(jsi::Runtime &rt, const jsi::PropNameID & if (name == "synchronizableSetBlocking") { return jsi::Function::createFromHostFunction( - rt, propName, 2, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + rt, + propName, + 2, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { auto synchronizable = extractSynchronizableOrThrow(rt, args[0]); - auto newValue = extractSerializableOrThrow(rt, args[1], "[Worklets] Value must be a Serializable."); - synchronizable->setBlocking(newValue); + auto newValue = extractSerializableOrThrow( + rt, args[1], "[Worklets] Value must be a Serializable."); + synchronizable->setBlocking(std::move(newValue)); return jsi::Value::undefined(); }); } if (name == "synchronizableLock") { return jsi::Function::createFromHostFunction( - rt, propName, 1, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + rt, + propName, + 1, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { auto synchronizable = extractSynchronizableOrThrow(rt, args[0]); synchronizable->lock(); return jsi::Value::undefined(); @@ -499,7 +644,13 @@ jsi::Value JSIWorkletsModuleProxy::get(jsi::Runtime &rt, const jsi::PropNameID & if (name == "synchronizableUnlock") { return jsi::Function::createFromHostFunction( - rt, propName, 1, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + rt, + propName, + 1, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { auto synchronizable = extractSynchronizableOrThrow(rt, args[0]); synchronizable->unlock(); return jsi::Value::undefined(); @@ -513,7 +664,10 @@ jsi::Value JSIWorkletsModuleProxy::get(jsi::Runtime &rt, const jsi::PropNameID & propName, 2, [runtimeManager = runtimeManager_]( - jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { return propagateModuleUpdate( runtimeManager, /* code */ args[0].asString(rt).utf8(rt), @@ -524,7 +678,13 @@ jsi::Value JSIWorkletsModuleProxy::get(jsi::Runtime &rt, const jsi::PropNameID & if (name == "getStaticFeatureFlag") { return jsi::Function::createFromHostFunction( - rt, propName, 2, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + rt, + propName, + 2, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { return worklets::StaticFeatureFlags::getFlag( /* name */ args[0].asString(rt).utf8(rt)); }); @@ -532,7 +692,13 @@ jsi::Value JSIWorkletsModuleProxy::get(jsi::Runtime &rt, const jsi::PropNameID & if (name == "setDynamicFeatureFlag") { return jsi::Function::createFromHostFunction( - rt, propName, 2, [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) { + rt, + propName, + 2, + [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) { worklets::DynamicFeatureFlags::setFlag( /* name */ args[0].asString(rt).utf8(rt), /* value */ args[1].asBool()); diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.h index b42529ee..755bdb3a 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.h @@ -5,7 +5,6 @@ #include #include -#include #include #include #include @@ -31,12 +30,11 @@ class JSIWorkletsModuleProxy : public jsi::HostObject { public: explicit JSIWorkletsModuleProxy( const bool isDevBundle, - const std::shared_ptr &script, + const std::shared_ptr &script, const std::string &sourceUrl, const std::shared_ptr &jsQueue, const std::shared_ptr &jsScheduler, const std::shared_ptr &uiScheduler, - const std::shared_ptr &memoryManager, const std::shared_ptr &runtimeManager, const std::weak_ptr &uiWorkletRuntime); @@ -64,7 +62,7 @@ class JSIWorkletsModuleProxy : public jsi::HostObject { return isDevBundle_; } - [[nodiscard]] std::shared_ptr getScript() const { + [[nodiscard]] std::shared_ptr getScript() const { return script_; } @@ -72,22 +70,17 @@ class JSIWorkletsModuleProxy : public jsi::HostObject { return sourceUrl_; } - [[nodiscard]] std::shared_ptr getMemoryManager() const { - return memoryManager_; - } - [[nodiscard]] std::shared_ptr getRuntimeManager() const { return runtimeManager_; } private: const bool isDevBundle_; - const std::shared_ptr script_; + const std::shared_ptr script_; const std::string sourceUrl_; const std::shared_ptr jsQueue_; const std::shared_ptr jsScheduler_; const std::shared_ptr uiScheduler_; - const std::shared_ptr memoryManager_; const std::shared_ptr runtimeManager_; const std::weak_ptr uiWorkletRuntime_; }; diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp index 50342854..4e72c838 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #ifdef __ANDROID__ @@ -13,7 +12,6 @@ #endif // __ANDROID__ #include -#include #include using namespace facebook; @@ -28,36 +26,44 @@ WorkletsModuleProxy::WorkletsModuleProxy( const std::shared_ptr &jsCallInvoker, const std::shared_ptr &uiScheduler, std::function &&isJavaScriptThread, - RuntimeBindings runtimeBindings, - const std::shared_ptr &script, + std::function)> + &&forwardedRequestAnimationFrame, + const std::shared_ptr &script, const std::string &sourceUrl) : isDevBundle_(isDevBundleFromRNRuntime(rnRuntime)), jsQueue_(jsQueue), - jsScheduler_(std::make_shared(rnRuntime, jsCallInvoker, std::move(isJavaScriptThread))), + jsScheduler_(std::make_shared( + rnRuntime, + jsCallInvoker, + std::move(isJavaScriptThread))), uiScheduler_(uiScheduler), jsLogger_(std::make_shared(jsScheduler_)), - runtimeBindings_(std::move(runtimeBindings)), script_(script), sourceUrl_(sourceUrl), - memoryManager_(std::make_shared()), runtimeManager_(std::make_shared()), - uiWorkletRuntime_( - runtimeManager_->createUninitializedUIRuntime(jsQueue_, std::make_shared(uiScheduler_))) { + uiWorkletRuntime_(runtimeManager_->createUninitializedUIRuntime( + jsQueue_, + std::make_shared(uiScheduler_))) { /** * We call additional `init` method here because * JSIWorkletsModuleProxy needs a weak_ptr to the UI Runtime. */ uiWorkletRuntime_->init(createJSIWorkletsModuleProxy()); - animationFrameBatchinator_ = - std::make_shared(uiWorkletRuntime_, runtimeBindings_.requestAnimationFrame); + animationFrameBatchinator_ = std::make_shared( + uiWorkletRuntime_->getJSIRuntime(), + std::move(forwardedRequestAnimationFrame)); UIRuntimeDecorator::decorate( - uiWorkletRuntime_->getJSIRuntime(), animationFrameBatchinator_->getJsiRequestAnimationFrame()); + uiWorkletRuntime_->getJSIRuntime(), + animationFrameBatchinator_->getJsiRequestAnimationFrame()); } -std::shared_ptr WorkletsModuleProxy::createJSIWorkletsModuleProxy() const { - assert(uiWorkletRuntime_ && "UI Worklet Runtime must be initialized before creating JSI proxy."); +std::shared_ptr +WorkletsModuleProxy::createJSIWorkletsModuleProxy() const { + assert( + uiWorkletRuntime_ && + "UI Worklet Runtime must be initialized before creating JSI proxy."); return std::make_shared( isDevBundle_, script_, @@ -65,7 +71,6 @@ std::shared_ptr WorkletsModuleProxy::createJSIWorkletsMo jsQueue_, jsScheduler_, uiScheduler_, - memoryManager_, runtimeManager_, uiWorkletRuntime_); } diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h index 0e54e9d3..a576e1af 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h @@ -5,8 +5,6 @@ #include #include #include -#include -#include #include #include #include @@ -19,7 +17,8 @@ namespace worklets { -class WorkletsModuleProxy : public std::enable_shared_from_this { +class WorkletsModuleProxy + : public std::enable_shared_from_this { public: explicit WorkletsModuleProxy( jsi::Runtime &rnRuntime, @@ -27,8 +26,9 @@ class WorkletsModuleProxy : public std::enable_shared_from_this &jsCallInvoker, const std::shared_ptr &uiScheduler, std::function &&isJavaScriptQueue, - RuntimeBindings runtimeBindings, - const std::shared_ptr &script, + std::function)> + &&forwardedRequestAnimationFrame, + const std::shared_ptr &script, const std::string &sourceUrl); ~WorkletsModuleProxy(); @@ -49,11 +49,13 @@ class WorkletsModuleProxy : public std::enable_shared_from_this getUIWorkletRuntime() const { + [[nodiscard]] inline std::shared_ptr getUIWorkletRuntime() + const { return uiWorkletRuntime_; } - [[nodiscard]] std::shared_ptr createJSIWorkletsModuleProxy() const; + [[nodiscard]] std::shared_ptr + createJSIWorkletsModuleProxy() const; [[nodiscard]] inline bool isDevBundle() const { return isDevBundle_; @@ -65,10 +67,8 @@ class WorkletsModuleProxy : public std::enable_shared_from_this jsScheduler_; const std::shared_ptr uiScheduler_; const std::shared_ptr jsLogger_; - const RuntimeBindings runtimeBindings_; - const std::shared_ptr script_; + const std::shared_ptr script_; const std::string sourceUrl_; - const std::shared_ptr memoryManager_; const std::shared_ptr runtimeManager_; std::shared_ptr uiWorkletRuntime_; std::shared_ptr animationFrameBatchinator_; diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp index 95f0dfaf..7e14d1d0 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp @@ -1,14 +1,13 @@ #include #include -#include -#include #include #include namespace worklets { -void EventHandlerRegistry::registerEventHandler(const std::shared_ptr &eventHandler) { +void EventHandlerRegistry::registerEventHandler( + const std::shared_ptr &eventHandler) { const std::lock_guard lock(instanceMutex); const auto &eventName = eventHandler->getEventName(); auto handlerId = eventHandler->getHandlerId(); @@ -62,27 +61,30 @@ void EventHandlerRegistry::processEvent( const std::lock_guard lock(instanceMutex); auto handlersIt = eventMappingsWithoutTag.find(eventName); if (handlersIt != eventMappingsWithoutTag.end()) { - for (const auto &handler : handlersIt->second) { + for (auto handler : handlersIt->second) { handlersForEvent.push_back(handler.second); } } const auto eventHash = std::make_pair(emitterReactTag, eventName); auto handlersWithTagIt = eventMappingsWithTag.find(eventHash); if (handlersWithTagIt != eventMappingsWithTag.end()) { - for (const auto &handler : handlersWithTagIt->second) { + for (auto handler : handlersWithTagIt->second) { handlersForEvent.push_back(handler.second); } } } jsi::Runtime &rt = uiWorkletRuntime->getJSIRuntime(); - eventPayload.asObject(rt).setProperty(rt, "eventName", jsi::String::createFromUtf8(rt, eventName)); - for (const auto &handler : handlersForEvent) { + eventPayload.asObject(rt).setProperty( + rt, "eventName", jsi::String::createFromUtf8(rt, eventName)); + for (auto handler : handlersForEvent) { handler->process(uiWorkletRuntime, eventTimestamp, eventPayload); } } -bool EventHandlerRegistry::isAnyHandlerWaitingForEvent(const std::string &eventName, const int emitterReactTag) { +bool EventHandlerRegistry::isAnyHandlerWaitingForEvent( + const std::string &eventName, + const int emitterReactTag) { const std::lock_guard lock(instanceMutex); const auto eventHash = std::make_pair(emitterReactTag, eventName); auto it = eventMappingsWithTag.find(eventHash); diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Registries/EventHandlerRegistry.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Registries/EventHandlerRegistry.h index 47158c6c..332bf6ff 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Registries/EventHandlerRegistry.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Registries/EventHandlerRegistry.h @@ -18,14 +18,20 @@ namespace worklets { class WorkletEventHandler; class EventHandlerRegistry { - std::map, std::unordered_map>> + std::map< + std::pair, + std::unordered_map>> eventMappingsWithTag; - std::map>> eventMappingsWithoutTag; + std::map< + std::string, + std::unordered_map>> + eventMappingsWithoutTag; std::map> eventHandlers; std::mutex instanceMutex; public: - void registerEventHandler(const std::shared_ptr &eventHandler); + void registerEventHandler( + const std::shared_ptr &eventHandler); void unregisterEventHandler(const uint64_t id); void processEvent( @@ -35,7 +41,9 @@ class EventHandlerRegistry { const int emitterReactTag, const jsi::Value &eventPayload); - bool isAnyHandlerWaitingForEvent(const std::string &eventName, const int emitterReactTag); + bool isAnyHandlerWaitingForEvent( + const std::string &eventName, + const int emitterReactTag); }; } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp index 61fe6fa8..035e345d 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp @@ -1,7 +1,5 @@ #include -#include - namespace worklets { std::set WorkletRuntimeRegistry::registry_{}; diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Resources/CustomSerializableUnpacker.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Resources/CustomSerializableUnpacker.cpp deleted file mode 100644 index 809b5d09..00000000 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Resources/CustomSerializableUnpacker.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// This file was generated with -// `packages/react-native-worklets/scripts/export-unpackers.js`. -// Please do not modify it directly. - -#include - -namespace worklets { - -const char CustomSerializableUnpackerCode[] = - R"DELIMITER__((function () { - if (!globalThis.__customSerializationRegistry) { - globalThis.__customSerializationRegistry = []; - } - var registry = globalThis.__customSerializationRegistry; - function customSerializableUnpacker(value, typeId) { - var data = registry[typeId]; - if (!data) { - throw new Error("[Worklets] No custom serializable registered for type ID ".concat(typeId, ".")); - } - return data.unpack(value); - } - globalThis.__customSerializableUnpacker = customSerializableUnpacker; -})();)DELIMITER__"; -} // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Resources/Unpackers.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Resources/Unpackers.h index 503833ed..87bb5b72 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Resources/Unpackers.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Resources/Unpackers.h @@ -3,5 +3,4 @@ namespace worklets { extern const char ValueUnpackerCode[]; extern const char SynchronizableUnpackerCode[]; -extern const char CustomSerializableUnpackerCode[]; } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Resources/ValueUnpacker.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Resources/ValueUnpacker.cpp index 661cf4aa..96b5c0de 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Resources/ValueUnpacker.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Resources/ValueUnpacker.cpp @@ -40,7 +40,7 @@ const char ValueUnpackerCode[] = } else if (category === 'RemoteFunction') { var fun = function fun() { var label = remoteFunctionName ? "function `".concat(remoteFunctionName, "`") : 'anonymous function'; - throw new Error("[Worklets] Tried to synchronously call a non-worklet ".concat(label, " on the UI thread.\nSee https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#tried-to-synchronously-call-a-non-worklet-function-on-the-ui-thread for more details.")); + throw new Error("[Worklets] Tried to synchronously call a non-worklet ".concat(label, " on the UI thread.\nSee https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#tried-to-synchronously-call-a-non-worklet-function-on-the-ui-thread for more details.")); }; fun.__remoteFunction = objectToUnpack; return fun; diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h deleted file mode 100644 index 0ec51464..00000000 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include - -namespace worklets { - -class AsyncQueue : public facebook::jsi::NativeState { - public: - ~AsyncQueue() override = default; - - virtual void push(std::function &&job) = 0; -}; - -} // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.cpp index 73a1614f..17af570b 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.cpp @@ -1,20 +1,20 @@ #include -#include -#include #include #include namespace worklets { -AsyncQueueImpl::AsyncQueueImpl(const std::string &name) : state_(std::make_shared()) { +AsyncQueueImpl::AsyncQueueImpl(std::string name) + : state_(std::make_shared()) { auto thread = std::thread([name, state = state_] { #if __APPLE__ pthread_setname_np(name.c_str()); #endif while (state->running) { std::unique_lock lock(state->mutex); - state->cv.wait(lock, [state] { return !state->queue.empty() || !state->running; }); + state->cv.wait( + lock, [state] { return !state->queue.empty() || !state->running; }); if (!state->running) { return; } @@ -50,7 +50,8 @@ void AsyncQueueImpl::push(std::function &&job) { state_->cv.notify_one(); } -AsyncQueueUI::AsyncQueueUI(const std::shared_ptr &uiScheduler) : uiScheduler_(uiScheduler) {} +AsyncQueueUI::AsyncQueueUI(const std::shared_ptr &uiScheduler) + : uiScheduler_(uiScheduler) {} void AsyncQueueUI::push(std::function &&job) { uiScheduler_->scheduleOnUI(std::move(job)); diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h index 72592049..7039da06 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include #include #include @@ -21,7 +21,7 @@ struct AsyncQueueState { class AsyncQueueImpl : public AsyncQueue { public: - explicit AsyncQueueImpl(const std::string &name); + explicit AsyncQueueImpl(std::string name); ~AsyncQueueImpl() override; diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.cpp index a5f02653..e0a7890e 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.cpp @@ -1,7 +1,5 @@ #include -#include -#include #include #include #include @@ -10,9 +8,12 @@ namespace worklets { EventLoop::EventLoop( const std::string &name, - const std::shared_ptr &runtime, + const std::shared_ptr runtime, const std::shared_ptr &queue) - : runtime_(runtime), queue_(queue), timeoutsQueueState_(std::make_shared()), name_(name) {} + : runtime_(runtime), + queue_(queue), + timeoutsQueueState_(std::make_shared()), + name_(name) {} EventLoop::~EventLoop() { { @@ -25,50 +26,52 @@ EventLoop::~EventLoop() { void EventLoop::run() { const auto threadName = name_ + "(timeout)"; - auto thread = std::thread([threadName, state = timeoutsQueueState_, weakThis = weak_from_this()] { + auto thread = std::thread( + [threadName, state = timeoutsQueueState_, weakThis = weak_from_this()] { #if __APPLE__ - pthread_setname_np(threadName.c_str()); + pthread_setname_np(threadName.c_str()); #endif - while (state->running) { - std::unique_lock lock(state->mutex); + while (state->running) { + std::unique_lock lock(state->mutex); - if (state->queue.empty()) { - state->cv.wait(lock); - } else { - const auto &nextTimeout = state->queue[0]; - const auto timeToWait = nextTimeout.targetTime - getCurrentTimeInMs(); - state->cv.wait_for(lock, std::chrono::milliseconds(timeToWait)); - } + if (state->queue.empty()) { + state->cv.wait(lock); + } else { + const auto &nextTimeout = state->queue[0]; + const auto timeToWait = + nextTimeout.targetTime - getCurrentTimeInMs(); + state->cv.wait_for(lock, std::chrono::milliseconds(timeToWait)); + } - // Early return if the Event Loop got destroyed already. - if (!state->running) { - return; - } + // Early return if the Event Loop got destroyed already. + if (!state->running) { + return; + } - const auto currentTime = getCurrentTimeInMs(); - std::vector> jobs; - auto &timeouts = state->queue; - timeouts.erase( - std::remove_if( - timeouts.begin(), - timeouts.end(), - [currentTime, &jobs](const Timeout &timeout) { - if (currentTime >= timeout.targetTime) { - jobs.emplace_back(timeout.callback); - return true; - } - return false; - }), - timeouts.end()); - lock.unlock(); + const auto currentTime = getCurrentTimeInMs(); + std::vector> jobs; + auto &timeouts = state->queue; + timeouts.erase( + std::remove_if( + timeouts.begin(), + timeouts.end(), + [currentTime, &jobs](const Timeout &timeout) { + if (currentTime >= timeout.targetTime) { + jobs.emplace_back(timeout.callback); + return true; + } + return false; + }), + timeouts.end()); + lock.unlock(); - if (auto strongThis = weakThis.lock()) { - for (auto &job : jobs) { - strongThis->pushTask(std::move(job)); + if (auto strongThis = weakThis.lock()) { + for (auto &job : jobs) { + strongThis->pushTask(std::move(job)); + } + } } - } - } - }); + }); #ifdef ANDROID pthread_setname_np(thread.native_handle(), threadName.c_str()); #endif @@ -76,14 +79,17 @@ void EventLoop::run() { } void EventLoop::pushTask(std::function &&job) { - queue_->push([weakRuntime = std::weak_ptr{runtime_}, job = std::move(job)] { + queue_->push([weakRuntime = std::weak_ptr{runtime_}, + job = std::move(job)] { if (auto runtime = weakRuntime.lock()) { job(*runtime); } }); } -void EventLoop::pushTimeout(std::function &&job, int64_t delay) { +void EventLoop::pushTimeout( + std::function &&job, + int64_t delay) { { std::unique_lock lock(timeoutsQueueState_->mutex); const auto targetTime = getCurrentTimeInMs() + delay; @@ -97,7 +103,8 @@ void EventLoop::pushTimeout(std::function &&job, int64_t int64_t EventLoop::getCurrentTimeInMs() { const auto currentTime = std::chrono::system_clock::now().time_since_epoch(); - return std::chrono::duration_cast(currentTime).count(); + return std::chrono::duration_cast(currentTime) + .count(); } } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.h index 885bbbe2..5a5b3714 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include #include #include @@ -33,7 +33,7 @@ class EventLoop : public std::enable_shared_from_this { public: EventLoop( const std::string &name, - const std::shared_ptr &runtime, + const std::shared_ptr runtime, const std::shared_ptr &queue); ~EventLoop(); void run(); diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/MemoryManager.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/MemoryManager.cpp deleted file mode 100644 index 1f0fe7d1..00000000 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/MemoryManager.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include -#include -#include -#include -#include - -namespace worklets { -void MemoryManager::loadAllCustomSerializables(const std::shared_ptr &runtime) { - std::lock_guard lock(customSerializationDataMutex_); - runtime->executeSync([&](jsi::Runtime &rt) -> jsi::Value { - const auto registry = getCustomSerializationRegistry(rt); - for (const auto &data : customSerializationData_) { - loadCustomSerializable(rt, registry, data); - } - return jsi::Value::undefined(); - }); -} - -void MemoryManager::loadCustomSerializable( - const std::shared_ptr &runtime, - const SerializationData &data) { - std::lock_guard lock(customSerializationDataMutex_); - runtime->executeSync([this, data](jsi::Runtime &rt) -> jsi::Value { - const auto registry = getCustomSerializationRegistry(rt); - loadCustomSerializable(rt, registry, data); - return jsi::Value::undefined(); - }); -} - -void MemoryManager::loadCustomSerializable( - jsi::Runtime &runtime, - const jsi::Array ®istry, - const SerializationData &data) { - react_native_assert( - registry.length(runtime) == data.typeId && - ("Custom serializable type ID must match registry length. Expected typeId: " + std::to_string(data.typeId) + - ", got registry length: " + std::to_string(registry.length(runtime)) + - ". Custom serializables must be registered in the same order across all runtimes.") - .c_str()); - - const auto item = jsi::Object(runtime); - item.setProperty(runtime, "determine", data.determine->toJSValue(runtime)); - item.setProperty(runtime, "pack", data.pack->toJSValue(runtime)); - item.setProperty(runtime, "unpack", data.unpack->toJSValue(runtime)); - item.setProperty(runtime, "typeId", data.typeId); - - registry.getPropertyAsFunction(runtime, "push").callWithThis(runtime, registry, item); -} - -void MemoryManager::registerCustomSerializable(const SerializationData &data) { - std::lock_guard lock(customSerializationDataMutex_); - customSerializationData_.emplace_back(data); -} - -jsi::Array MemoryManager::getCustomSerializationRegistry(jsi::Runtime &rt) { - const auto data = rt.global().getProperty(rt, "__customSerializationRegistry"); - return data.asObject(rt).asArray(rt); -} - -} // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/MemoryManager.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/MemoryManager.h deleted file mode 100644 index b0366c3d..00000000 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/MemoryManager.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include -#include -#include - -namespace worklets { -class MemoryManager { - public: - void loadAllCustomSerializables(const std::shared_ptr &workletRuntime); - - void loadCustomSerializable(const std::shared_ptr &workletRuntime, const SerializationData &data); - - void registerCustomSerializable(const SerializationData &data); - - private: - static jsi::Array getCustomSerializationRegistry(jsi::Runtime &rt); - - void loadCustomSerializable(jsi::Runtime &runtime, const jsi::Array ®istry, const SerializationData &data); - - std::mutex customSerializationDataMutex_; - std::vector customSerializationData_; -}; -} // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.cpp index 67ff75a9..76f513bc 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.cpp @@ -1,10 +1,6 @@ #include #include -#include -#include -#include - using namespace facebook; namespace worklets { @@ -15,6 +11,34 @@ jsi::Function getValueUnpacker(jsi::Runtime &rt) { return valueUnpacker.asObject(rt).asFunction(rt); } +#ifndef NDEBUG + +static const auto callGuardLambda = [](facebook::jsi::Runtime &rt, + const facebook::jsi::Value &thisVal, + const facebook::jsi::Value *args, + size_t count) { + return args[0].asObject(rt).asFunction(rt).call(rt, args + 1, count - 1); +}; + +jsi::Function getCallGuard(jsi::Runtime &rt) { + auto callGuard = rt.global().getProperty(rt, "__callGuardDEV"); + if (callGuard.isObject()) { + // Use JS implementation if `__callGuardDEV` has already been installed. + // This is the desired behavior. + return callGuard.asObject(rt).asFunction(rt); + } + + // Otherwise, fallback to C++ JSI implementation. This is necessary so that we + // can install `__callGuardDEV` itself and should happen only once. Note that + // the C++ implementation doesn't intercept errors and simply throws them as + // C++ exceptions which crashes the app. We assume that installing the guard + // doesn't throw any errors. + return jsi::Function::createFromHostFunction( + rt, jsi::PropNameID::forAscii(rt, "callGuard"), 1, callGuardLambda); +} + +#endif // NDEBUG + jsi::Value makeSerializableClone( jsi::Runtime &rt, const jsi::Value &value, @@ -34,26 +58,35 @@ jsi::Value makeSerializableClone( return makeSerializableFunction(rt, object.asFunction(rt)); } else if (object.isArray(rt)) { if (shouldRetainRemote.isBool() && shouldRetainRemote.getBool()) { - serializable = std::make_shared>(rt, object.asArray(rt)); + serializable = + std::make_shared>( + rt, object.asArray(rt)); } else { - serializable = std::make_shared(rt, object.asArray(rt)); + serializable = + std::make_shared(rt, object.asArray(rt)); } } else if (object.isArrayBuffer(rt)) { - serializable = std::make_shared(rt, object.getArrayBuffer(rt)); + serializable = std::make_shared( + rt, object.getArrayBuffer(rt)); } else if (object.isHostObject(rt)) { if (object.isHostObject(rt)) { return object; } - serializable = std::make_shared(rt, object.getHostObject(rt)); + serializable = std::make_shared( + rt, object.getHostObject(rt)); } else { if (shouldRetainRemote.isBool() && shouldRetainRemote.getBool()) { - serializable = std::make_shared>(rt, object, nativeStateSource); + serializable = + std::make_shared>( + rt, object, nativeStateSource); } else { - serializable = std::make_shared(rt, object, nativeStateSource); + serializable = + std::make_shared(rt, object, nativeStateSource); } } } else if (value.isString()) { - serializable = std::make_shared(value.asString(rt).utf8(rt)); + serializable = + std::make_shared(value.asString(rt).utf8(rt)); } else if (value.isUndefined()) { serializable = std::make_shared(); } else if (value.isNull()) { @@ -63,21 +96,25 @@ jsi::Value makeSerializableClone( } else if (value.isNumber()) { serializable = std::make_shared(value.getNumber()); } else if (value.isBigInt()) { - serializable = std::make_shared(rt, value.getBigInt(rt)); + serializable = + std::make_shared(rt, value.getBigInt(rt)); } else if (value.isSymbol()) { // TODO: this is only a placeholder implementation, here we replace symbols // with strings in order to make certain objects to be captured. There isn't - // yet any use-case for using symbols on the UI runtime so it is fine to keep + // yet any usecase for using symbols on the UI runtime so it is fine to keep // it like this for now. - serializable = std::make_shared(value.getSymbol(rt).toString(rt)); + serializable = + std::make_shared(value.getSymbol(rt).toString(rt)); } else { - throw std::runtime_error("[Worklets] Attempted to convert an unsupported value type."); + throw std::runtime_error( + "[Worklets] Attempted to convert an unsupported value type."); } return SerializableJSRef::newNativeStateObject(rt, serializable); } jsi::Value makeSerializableString(jsi::Runtime &rt, const jsi::String &string) { - const auto serializable = std::make_shared(string.utf8(rt)); + const auto serializable = + std::make_shared(string.utf8(rt)); return SerializableJSRef::newNativeStateObject(rt, serializable); } @@ -106,42 +143,58 @@ jsi::Value makeSerializableNull(jsi::Runtime &rt) { return SerializableJSRef::newNativeStateObject(rt, serializable); } -jsi::Value makeSerializableWorklet(jsi::Runtime &rt, const jsi::Object &object, const bool &shouldRetainRemote) { +jsi::Value makeSerializableWorklet( + jsi::Runtime &rt, + const jsi::Object &object, + const bool &shouldRetainRemote) { std::shared_ptr serializable; if (shouldRetainRemote) { - serializable = std::make_shared>(rt, object); + serializable = std::make_shared>( + rt, object); } else { serializable = std::make_shared(rt, object); } return SerializableJSRef::newNativeStateObject(rt, serializable); } -jsi::Value makeSerializableInitializer(jsi::Runtime &rt, const jsi::Object &initializerObject) { - const auto serializable = std::make_shared(rt, initializerObject); +jsi::Value makeSerializableInitializer( + jsi::Runtime &rt, + const jsi::Object &initializerObject) { + const auto serializable = + std::make_shared(rt, initializerObject); return SerializableJSRef::newNativeStateObject(rt, serializable); } jsi::Value makeSerializableFunction(jsi::Runtime &rt, jsi::Function function) { std::shared_ptr serializable; if (function.isHostFunction(rt)) { - serializable = std::make_shared(rt, std::move(function)); + serializable = + std::make_shared(rt, std::move(function)); } else { - serializable = std::make_shared(rt, std::move(function)); + serializable = + std::make_shared(rt, std::move(function)); } return SerializableJSRef::newNativeStateObject(rt, serializable); } -jsi::Value makeSerializableArray(jsi::Runtime &rt, const jsi::Array &array, const jsi::Value &shouldRetainRemote) { +jsi::Value makeSerializableArray( + jsi::Runtime &rt, + const jsi::Array &array, + const jsi::Value &shouldRetainRemote) { std::shared_ptr serializable; if (shouldRetainRemote.isBool() && shouldRetainRemote.getBool()) { - serializable = std::make_shared>(rt, array); + serializable = + std::make_shared>(rt, array); } else { serializable = std::make_shared(rt, array); } return SerializableJSRef::newNativeStateObject(rt, serializable); } -jsi::Value makeSerializableMap(jsi::Runtime &rt, const jsi::Array &keys, const jsi::Array &values) { +jsi::Value makeSerializableMap( + jsi::Runtime &rt, + const jsi::Array &keys, + const jsi::Array &values) { auto serializable = std::make_shared(rt, keys, values); return SerializableJSRef::newNativeStateObject(rt, serializable); } @@ -151,7 +204,9 @@ jsi::Value makeSerializableSet(jsi::Runtime &rt, const jsi::Array &values) { return SerializableJSRef::newNativeStateObject(rt, serializable); } -jsi::Value makeSerializableHostObject(jsi::Runtime &rt, const std::shared_ptr &value) { +jsi::Value makeSerializableHostObject( + jsi::Runtime &rt, + const std::shared_ptr &value) { const auto serializable = std::make_shared(rt, value); return SerializableJSRef::newNativeStateObject(rt, serializable); } @@ -160,12 +215,17 @@ jsi::Value makeSerializableTurboModuleLike( jsi::Runtime &rt, const jsi::Object &object, const std::shared_ptr &proto) { - const auto serializable = std::make_shared(rt, object, proto); + const auto serializable = + std::make_shared(rt, object, proto); return SerializableJSRef::newNativeStateObject(rt, serializable); } -jsi::Value makeSerializableImport(jsi::Runtime &rt, const double source, const jsi::String &imported) { - auto serializable = std::make_shared(rt, source, imported); +jsi::Value makeSerializableImport( + jsi::Runtime &rt, + const double source, + const jsi::String &imported) { + auto serializable = + std::make_shared(rt, source, imported); return SerializableJSRef::newNativeStateObject(rt, serializable); } @@ -176,9 +236,11 @@ jsi::Value makeSerializableObject( const jsi::Value &nativeStateSource) { std::shared_ptr serializable; if (shouldRetainRemote) { - serializable = std::make_shared>(rt, object, nativeStateSource); + serializable = std::make_shared>( + rt, object, nativeStateSource); } else { - serializable = std::make_shared(rt, object, nativeStateSource); + serializable = + std::make_shared(rt, object, nativeStateSource); } return SerializableJSRef::newNativeStateObject(rt, serializable); } @@ -193,14 +255,15 @@ std::shared_ptr extractSerializableOrThrow( auto nativeState = object.getNativeState(rt); return std::dynamic_pointer_cast(nativeState)->value(); } - throw std::runtime_error("[Worklets] Attempted to extract from a Object that wasn't converted to a Serializable."); + throw std::runtime_error( + "[Worklets] Attempted to extract from a Object that wasn't converted to a Serializable."); } else if (maybeSerializableValue.isUndefined()) { return Serializable::undefined(); } throw std::runtime_error(errorMessage); } -Serializable::~Serializable() = default; +Serializable::~Serializable() {} std::shared_ptr Serializable::undefined() { static auto undefined = std::make_shared(); @@ -230,13 +293,15 @@ jsi::Value RetainingSerializable::toJSValue(jsi::Runtime &rt) { return BaseClass::toJSValue(rt); } -SerializableJSRef::~SerializableJSRef() = default; +SerializableJSRef::~SerializableJSRef() {} -SerializableArray::SerializableArray(jsi::Runtime &rt, const jsi::Array &array) : Serializable(ValueType::ArrayType) { +SerializableArray::SerializableArray(jsi::Runtime &rt, const jsi::Array &array) + : Serializable(ArrayType) { auto size = array.size(rt); data_.reserve(size); for (size_t i = 0; i < size; i++) { - data_.push_back(extractSerializableOrThrow(rt, array.getValueAtIndex(rt, i))); + data_.push_back( + extractSerializableOrThrow(rt, array.getValueAtIndex(rt, i))); } } @@ -251,14 +316,19 @@ jsi::Value SerializableArray::toJSValue(jsi::Runtime &rt) { jsi::Value SerializableArrayBuffer::toJSValue(jsi::Runtime &rt) { auto size = static_cast(data_.size()); - auto arrayBuffer = - rt.global().getPropertyAsFunction(rt, "ArrayBuffer").callAsConstructor(rt, size).getObject(rt).getArrayBuffer(rt); + auto arrayBuffer = rt.global() + .getPropertyAsFunction(rt, "ArrayBuffer") + .callAsConstructor(rt, size) + .getObject(rt) + .getArrayBuffer(rt); memcpy(arrayBuffer.data(rt), data_.data(), size); return arrayBuffer; } -SerializableObject::SerializableObject(jsi::Runtime &rt, const jsi::Object &object) - : Serializable(ValueType::ObjectType) { +SerializableObject::SerializableObject( + jsi::Runtime &rt, + const jsi::Object &object) + : Serializable(ObjectType) { auto propertyNames = object.getPropertyNames(rt); auto size = propertyNames.size(rt); data_.reserve(size); @@ -272,17 +342,24 @@ SerializableObject::SerializableObject(jsi::Runtime &rt, const jsi::Object &obje } } -SerializableObject::SerializableObject(jsi::Runtime &rt, const jsi::Object &object, const jsi::Value &nativeStateSource) +SerializableObject::SerializableObject( + jsi::Runtime &rt, + const jsi::Object &object, + const jsi::Value &nativeStateSource) : SerializableObject(rt, object) { - if (nativeStateSource.isObject() && nativeStateSource.asObject(rt).hasNativeState(rt)) { + if (nativeStateSource.isObject() && + nativeStateSource.asObject(rt).hasNativeState(rt)) { nativeState_ = nativeStateSource.asObject(rt).getNativeState(rt); } } jsi::Value SerializableObject::toJSValue(jsi::Runtime &rt) { auto obj = jsi::Object(rt); - for (const auto &i : data_) { - obj.setProperty(rt, jsi::String::createFromUtf8(rt, i.first), i.second->toJSValue(rt)); + for (size_t i = 0, size = data_.size(); i < size; i++) { + obj.setProperty( + rt, + jsi::String::createFromUtf8(rt, data_[i].first), + data_[i].second->toJSValue(rt)); } if (nativeState_ != nullptr) { obj.setNativeState(rt, nativeState_); @@ -290,10 +367,15 @@ jsi::Value SerializableObject::toJSValue(jsi::Runtime &rt) { return obj; } -SerializableMap::SerializableMap(jsi::Runtime &rt, const jsi::Array &keys, const jsi::Array &values) - : Serializable(ValueType::MapType) { +SerializableMap::SerializableMap( + jsi::Runtime &rt, + const jsi::Array &keys, + const jsi::Array &values) + : Serializable(MapType) { auto size = keys.size(rt); - react_native_assert(size == values.size(rt) && "Keys and values arrays must have the same size."); + react_native_assert( + size == values.size(rt) && + "Keys and values arrays must have the same size."); data_.reserve(size); for (size_t i = 0; i < size; i++) { auto key = extractSerializableOrThrow(rt, keys.getValueAtIndex(rt, i)); @@ -312,16 +394,19 @@ jsi::Value SerializableMap::toJSValue(jsi::Runtime &rt) { } const auto &global = rt.global(); - auto map = global.getPropertyAsFunction(rt, "Map").callAsConstructor(rt, std::move(keyValues)); + auto map = global.getPropertyAsFunction(rt, "Map").callAsConstructor( + rt, std::move(keyValues)); return map; } -SerializableSet::SerializableSet(jsi::Runtime &rt, const jsi::Array &values) : Serializable(ValueType::SetType) { +SerializableSet::SerializableSet(jsi::Runtime &rt, const jsi::Array &values) + : Serializable(SetType) { auto size = values.size(rt); data_.reserve(size); for (size_t i = 0; i < size; i++) { - data_.push_back(extractSerializableOrThrow(rt, values.getValueAtIndex(rt, i))); + data_.push_back( + extractSerializableOrThrow(rt, values.getValueAtIndex(rt, i))); } } @@ -332,7 +417,8 @@ jsi::Value SerializableSet::toJSValue(jsi::Runtime &rt) { } const auto &global = rt.global(); - auto set = global.getPropertyAsFunction(rt, "Set").callAsConstructor(rt, std::move(values)); + auto set = global.getPropertyAsFunction(rt, "Set").callAsConstructor( + rt, std::move(values)); return set; } @@ -342,15 +428,20 @@ jsi::Value SerializableHostObject::toJSValue(jsi::Runtime &rt) { } jsi::Value SerializableHostFunction::toJSValue(jsi::Runtime &rt) { - return jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forUtf8(rt, name_), paramCount_, hostFunction_); + return jsi::Function::createFromHostFunction( + rt, jsi::PropNameID::forUtf8(rt, name_), paramCount_, hostFunction_); } jsi::Value SerializableWorklet::toJSValue(jsi::Runtime &rt) { react_native_assert( - std::any_of(data_.cbegin(), data_.cend(), [](const auto &item) { return item.first == "__workletHash"; }) && + std::any_of( + data_.cbegin(), + data_.cend(), + [](const auto &item) { return item.first == "__workletHash"; }) && "SerializableWorklet doesn't have `__workletHash` property"); jsi::Value obj = SerializableObject::toJSValue(rt); - return getValueUnpacker(rt).call(rt, obj, jsi::String::createFromAscii(rt, "Worklet")); + return getValueUnpacker(rt).call( + rt, obj, jsi::String::createFromAscii(rt, "Worklet")); } jsi::Value SerializableImport::toJSValue(jsi::Runtime &rt) { @@ -364,7 +455,11 @@ jsi::Value SerializableImport::toJSValue(jsi::Runtime &rt) { } const auto imported = jsi::String::createFromUtf8(rt, imported_); - return metroRequire.asObject(rt).asFunction(rt).call(rt, source_).asObject(rt).getProperty(rt, imported); + return metroRequire.asObject(rt) + .asFunction(rt) + .call(rt, source_) + .asObject(rt) + .getProperty(rt, imported); } jsi::Value SerializableRemoteFunction::toJSValue(jsi::Runtime &rt) { @@ -386,12 +481,12 @@ jsi::Value SerializableRemoteFunction::toJSValue(jsi::Runtime &rt) { jsi::Value SerializableInitializer::toJSValue(jsi::Runtime &rt) { if (remoteValue_ == nullptr) { auto initObj = initializer_->toJSValue(rt); - auto value = std::make_unique( - getValueUnpacker(rt).call(rt, initObj, jsi::String::createFromAscii(rt, "Handle"))); + auto value = std::make_unique(getValueUnpacker(rt).call( + rt, initObj, jsi::String::createFromAscii(rt, "Handle"))); // We are locking the initialization here since the thread that is - // initializing can be preempted on runtime lock. E.g. - // UI thread can be preempted on initialization of a shared value and then + // initalizing can be pre-empted on runtime lock. E.g. + // UI thread can be pre-empted on initialization of a shared value and then // JS thread can try to access the shared value, locking the whole runtime. // If we put the lock on `getValueUnpacker` part (basically any part that // requires runtime) we would get a deadlock since UI thread would never @@ -406,7 +501,8 @@ jsi::Value SerializableInitializer::toJSValue(jsi::Runtime &rt) { return jsi::Value(rt, *remoteValue_); } auto initObj = initializer_->toJSValue(rt); - return getValueUnpacker(rt).call(rt, initObj, jsi::String::createFromAscii(rt, "Handle")); + return getValueUnpacker(rt).call( + rt, initObj, jsi::String::createFromAscii(rt, "Handle")); } jsi::Value SerializableString::toJSValue(jsi::Runtime &rt) { @@ -414,58 +510,36 @@ jsi::Value SerializableString::toJSValue(jsi::Runtime &rt) { } jsi::Value SerializableBigInt::toJSValue(jsi::Runtime &rt) { - if (fastValue_.has_value()) { - return jsi::BigInt::fromInt64(rt, fastValue_.value()); - } else { - return rt.global().getPropertyAsFunction(rt, "BigInt").call(rt, jsi::String::createFromUtf8(rt, slowValue_)); - } + return rt.global() + .getPropertyAsFunction(rt, "BigInt") + .call(rt, jsi::String::createFromUtf8(rt, string_)); } jsi::Value SerializableScalar::toJSValue(jsi::Runtime &) { switch (valueType_) { - case Serializable::ValueType::UndefinedType: + case Serializable::UndefinedType: return jsi::Value(); - case Serializable::ValueType::NullType: + case Serializable::NullType: return jsi::Value(nullptr); - case Serializable::ValueType::BooleanType: + case Serializable::BooleanType: return jsi::Value(data_.boolean); - case Serializable::ValueType::NumberType: + case Serializable::NumberType: return jsi::Value(data_.number); default: - throw std::runtime_error("[Worklets] Attempted to convert object that's not of a scalar type."); + throw std::runtime_error( + "[Worklets] Attempted to convert object that's not of a scalar type."); } } jsi::Value SerializableTurboModuleLike::toJSValue(jsi::Runtime &rt) { auto obj = properties_->toJSValue(rt).asObject(rt); const auto prototype = proto_->toJSValue(rt); - rt.global().getPropertyAsObject(rt, "Object").getPropertyAsFunction(rt, "setPrototypeOf").call(rt, obj, prototype); + rt.global() + .getPropertyAsObject(rt, "Object") + .getPropertyAsFunction(rt, "setPrototypeOf") + .call(rt, obj, prototype); return obj; } -jsi::Function getCustomSerializableUnpacker(jsi::Runtime &rt) { - auto customSerializableUnpacker = rt.global().getProperty(rt, "__customSerializableUnpacker"); - react_native_assert(customSerializableUnpacker.isObject() && "customSerializableUnpacker not found"); - return customSerializableUnpacker.asObject(rt).asFunction(rt); -} - -jsi::Value CustomSerializable::toJSValue(jsi::Runtime &rt) { - try { - auto unpack = getCustomSerializableUnpacker(rt); - auto data = data_->toJSValue(rt); - - return unpack.call(rt, data, jsi::Value(typeId_)); - } catch (jsi::JSError &e) { - throw std::runtime_error( - std::string("[Worklets] Failed to deserialize CustomSerializable. Reason: ") + e.getMessage()); - } -} - -jsi::Value makeCustomSerializable(jsi::Runtime &rt, const jsi::Value &data, const int typeId) { - auto rawData = extractSerializableOrThrow(rt, data, "[Worklets] Data must be a Serializable object."); - auto customSerializable = std::make_shared(rawData, typeId); - return SerializableJSRef::newNativeStateObject(rt, customSerializable); -} - } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.h index 771b6be9..18012344 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.h @@ -15,7 +15,30 @@ namespace worklets { jsi::Function getValueUnpacker(jsi::Runtime &rt); -inline void cleanupIfRuntimeExists(jsi::Runtime *rt, std::unique_ptr &value) { +#ifndef NDEBUG +jsi::Function getCallGuard(jsi::Runtime &rt); +#endif // NDEBUG + +// If possible, please use `WorkletRuntime::runGuarded` instead. +template +inline jsi::Value runOnRuntimeGuarded( + jsi::Runtime &rt, + const jsi::Value &function, + Args &&...args) { + // We only use callGuard in debug mode, otherwise we call the provided + // function directly. CallGuard provides a way of capturing exceptions in + // JavaScript and propagating them to the main React Native thread such that + // they can be presented using RN's LogBox. +#ifndef NDEBUG + return getCallGuard(rt).call(rt, function, args...); +#else + return function.asObject(rt).asFunction(rt).call(rt, args...); +#endif // NDEBUG +} + +inline void cleanupIfRuntimeExists( + jsi::Runtime *rt, + std::unique_ptr &value) { if (rt != nullptr && !WorkletRuntimeRegistry::isRuntimeAlive(rt)) { // The below use of unique_ptr.release prevents the smart pointer from // calling the destructor of the kept object. This effectively results in @@ -35,7 +58,7 @@ inline void cleanupIfRuntimeExists(jsi::Runtime *rt, std::unique_ptr // before the runtime is terminated. Note that the underlying memory that // jsi::Value refers to is managed by the VM and gets freed along with the // runtime. - value.release(); // NOLINT + value.release(); } } @@ -45,7 +68,7 @@ class Serializable { virtual ~Serializable(); - enum class ValueType : std::uint8_t { + enum ValueType { UndefinedType, NullType, BooleanType, @@ -66,7 +89,6 @@ class Serializable { TurboModuleLikeType, ImportType, SynchronizableType, - CustomType, }; explicit Serializable(ValueType valueType) : valueType_(valueType) {} @@ -105,15 +127,18 @@ class SerializableJSRef : public jsi::NativeState { const std::shared_ptr value_; public: - explicit SerializableJSRef(const std::shared_ptr &value) : value_(value) {} + explicit SerializableJSRef(const std::shared_ptr &value) + : value_(value) {} - ~SerializableJSRef() override; + virtual ~SerializableJSRef(); std::shared_ptr value() const { return value_; } - static jsi::Object newNativeStateObject(jsi::Runtime &rt, const std::shared_ptr &value) { + static jsi::Object newNativeStateObject( + jsi::Runtime &rt, + const std::shared_ptr &value) { auto object = jsi::Object(rt); object.setNativeState(rt, std::make_shared(value)); object.setProperty(rt, "__serializableRef", true); @@ -150,35 +175,52 @@ jsi::Value makeSerializableObject( bool shouldRetainRemote, const jsi::Value &nativeStateSource); -jsi::Value makeSerializableImport(jsi::Runtime &rt, double source, const jsi::String &imported); +jsi::Value makeSerializableImport( + jsi::Runtime &rt, + const double source, + const jsi::String &imported); -jsi::Value makeSerializableHostObject(jsi::Runtime &rt, const std::shared_ptr &value); +jsi::Value makeSerializableHostObject( + jsi::Runtime &rt, + const std::shared_ptr &value); -jsi::Value makeSerializableArray(jsi::Runtime &rt, const jsi::Array &array, const jsi::Value &shouldRetainRemote); +jsi::Value makeSerializableArray( + jsi::Runtime &rt, + const jsi::Array &array, + const jsi::Value &shouldRetainRemote); -jsi::Value makeSerializableMap(jsi::Runtime &rt, const jsi::Array &keys, const jsi::Array &values); +jsi::Value makeSerializableMap( + jsi::Runtime &rt, + const jsi::Array &keys, + const jsi::Array &values); jsi::Value makeSerializableSet(jsi::Runtime &rt, const jsi::Array &values); -jsi::Value makeSerializableInitializer(jsi::Runtime &rt, const jsi::Object &initializerObject); +jsi::Value makeSerializableInitializer( + jsi::Runtime &rt, + const jsi::Object &initializerObject); jsi::Value makeSerializableFunction(jsi::Runtime &rt, jsi::Function function); -jsi::Value makeSerializableWorklet(jsi::Runtime &rt, const jsi::Object &object, const bool &shouldRetainRemote); - -jsi::Value makeCustomSerializable(jsi::Runtime &rt, const jsi::Value &data, int typeId); +jsi::Value makeSerializableWorklet( + jsi::Runtime &rt, + const jsi::Object &object, + const bool &shouldRetainRemote); std::shared_ptr extractSerializableOrThrow( jsi::Runtime &rt, const jsi::Value &maybeSerializableValue, - const std::string &errorMessage = "[Worklets] Expecting the object to be of type SerializableJSRef."); + const std::string &errorMessage = + "[Worklets] Expecting the object to be of type SerializableJSRef."); template std::shared_ptr extractSerializableOrThrow( jsi::Runtime &rt, const jsi::Value &serializableRef, - const std::string &errorMessage = "[Worklets] Provided serializable object is of an incompatible type.") { - auto res = std::dynamic_pointer_cast(extractSerializableOrThrow(rt, serializableRef, errorMessage)); + const std::string &errorMessage = + "[Worklets] Provided serializable object is of an incompatible type.") { + auto res = std::dynamic_pointer_cast( + extractSerializableOrThrow(rt, serializableRef, errorMessage)); if (!res) { throw std::runtime_error(errorMessage); } @@ -199,7 +241,10 @@ class SerializableObject : public Serializable { public: SerializableObject(jsi::Runtime &rt, const jsi::Object &object); - SerializableObject(jsi::Runtime &rt, const jsi::Object &object, const jsi::Value &nativeStateSource); + SerializableObject( + jsi::Runtime &rt, + const jsi::Object &object, + const jsi::Value &nativeStateSource); jsi::Value toJSValue(jsi::Runtime &rt) override; @@ -210,12 +255,17 @@ class SerializableObject : public Serializable { class SerializableMap : public Serializable { public: - SerializableMap(jsi::Runtime &rt, const jsi::Array &keys, const jsi::Array &values); + SerializableMap( + jsi::Runtime &rt, + const jsi::Array &keys, + const jsi::Array &values); jsi::Value toJSValue(jsi::Runtime &rt) override; protected: - std::vector, std::shared_ptr>> data_; + std::vector< + std::pair, std::shared_ptr>> + data_; }; class SerializableSet : public Serializable { @@ -230,8 +280,10 @@ class SerializableSet : public Serializable { class SerializableHostObject : public Serializable { public: - SerializableHostObject(jsi::Runtime &, const std::shared_ptr &hostObject) - : Serializable(ValueType::HostObjectType), hostObject_(hostObject) {} + SerializableHostObject( + jsi::Runtime &, + const std::shared_ptr &hostObject) + : Serializable(HostObjectType), hostObject_(hostObject) {} jsi::Value toJSValue(jsi::Runtime &rt) override; @@ -242,7 +294,7 @@ class SerializableHostObject : public Serializable { class SerializableHostFunction : public Serializable { public: SerializableHostFunction(jsi::Runtime &rt, jsi::Function function) - : Serializable(ValueType::HostFunctionType), + : Serializable(HostFunctionType), hostFunction_(function.getHostFunction(rt)), name_(function.getProperty(rt, "name").asString(rt).utf8(rt)), paramCount_(function.getProperty(rt, "length").asNumber()) {} @@ -258,8 +310,10 @@ class SerializableHostFunction : public Serializable { class SerializableArrayBuffer : public Serializable { public: SerializableArrayBuffer(jsi::Runtime &rt, const jsi::ArrayBuffer &arrayBuffer) - : Serializable(ValueType::ArrayBufferType), - data_(arrayBuffer.data(rt), arrayBuffer.data(rt) + arrayBuffer.size(rt)) {} + : Serializable(ArrayBufferType), + data_( + arrayBuffer.data(rt), + arrayBuffer.data(rt) + arrayBuffer.size(rt)) {} jsi::Value toJSValue(jsi::Runtime &rt) override; @@ -269,8 +323,9 @@ class SerializableArrayBuffer : public Serializable { class SerializableWorklet : public SerializableObject { public: - SerializableWorklet(jsi::Runtime &rt, const jsi::Object &worklet) : SerializableObject(rt, worklet) { - valueType_ = ValueType::WorkletType; + SerializableWorklet(jsi::Runtime &rt, const jsi::Object &worklet) + : SerializableObject(rt, worklet) { + valueType_ = WorkletType; } jsi::Value toJSValue(jsi::Runtime &rt) override; @@ -278,8 +333,13 @@ class SerializableWorklet : public SerializableObject { class SerializableImport : public Serializable { public: - SerializableImport(jsi::Runtime &rt, const double source, const jsi::String &imported) - : Serializable(ValueType::ImportType), source_(source), imported_(imported.utf8(rt)) {} + SerializableImport( + jsi::Runtime &rt, + const double source, + const jsi::String &imported) + : Serializable(ImportType), + source_(source), + imported_(imported.utf8(rt)) {} jsi::Value toJSValue(jsi::Runtime &rt) override; @@ -288,8 +348,9 @@ class SerializableImport : public Serializable { const std::string imported_; }; -class SerializableRemoteFunction : public Serializable, - public std::enable_shared_from_this { +class SerializableRemoteFunction + : public Serializable, + public std::enable_shared_from_this { private: jsi::Runtime *runtime_; #ifndef NDEBUG @@ -299,7 +360,7 @@ class SerializableRemoteFunction : public Serializable, public: SerializableRemoteFunction(jsi::Runtime &rt, jsi::Function &&function) - : Serializable(ValueType::RemoteFunctionType), + : Serializable(RemoteFunctionType), runtime_(&rt), #ifndef NDEBUG name_(function.getProperty(rt, "name").asString(rt).utf8(rt)), @@ -307,7 +368,7 @@ class SerializableRemoteFunction : public Serializable, function_(std::make_unique(rt, std::move(function))) { } - ~SerializableRemoteFunction() override { + ~SerializableRemoteFunction() { cleanupIfRuntimeExists(runtime_, function_); } @@ -326,11 +387,14 @@ class SerializableInitializer : public Serializable { jsi::Runtime *remoteRuntime_; public: - SerializableInitializer(jsi::Runtime &rt, const jsi::Object &initializerObject) - : Serializable(ValueType::HandleType), - initializer_(std::make_unique(rt, initializerObject)) {} + SerializableInitializer( + jsi::Runtime &rt, + const jsi::Object &initializerObject) + : Serializable(HandleType), + initializer_( + std::make_unique(rt, initializerObject)) {} - ~SerializableInitializer() override { + ~SerializableInitializer() { cleanupIfRuntimeExists(remoteRuntime_, remoteValue_); } @@ -339,7 +403,8 @@ class SerializableInitializer : public Serializable { class SerializableString : public Serializable { public: - explicit SerializableString(const std::string &string) : Serializable(ValueType::StringType), data_(string) {} + explicit SerializableString(const std::string &string) + : Serializable(StringType), data_(string) {} jsi::Value toJSValue(jsi::Runtime &rt) override; @@ -349,36 +414,27 @@ class SerializableString : public Serializable { class SerializableBigInt : public Serializable { public: - explicit SerializableBigInt(jsi::Runtime &rt, const jsi::BigInt &bigInt) : Serializable(ValueType::BigIntType) { - if (bigInt.isInt64(rt)) { - fastValue_ = bigInt.getInt64(rt); - } else { - slowValue_ = bigInt.toString(rt).utf8(rt); - } - } + explicit SerializableBigInt(jsi::Runtime &rt, const jsi::BigInt &bigint) + : Serializable(BigIntType), string_(bigint.toString(rt).utf8(rt)) {} jsi::Value toJSValue(jsi::Runtime &rt) override; protected: - /** - * This member is used only when the BigInt fits into int64_t range. - */ - std::optional fastValue_{}; - std::string slowValue_{}; + const std::string string_; }; class SerializableScalar : public Serializable { public: - explicit SerializableScalar(double number) : Serializable(ValueType::NumberType) { + explicit SerializableScalar(double number) : Serializable(NumberType) { data_.number = number; } - explicit SerializableScalar(bool boolean) : Serializable(ValueType::BooleanType) { + explicit SerializableScalar(bool boolean) : Serializable(BooleanType) { data_.boolean = boolean; } - SerializableScalar() : Serializable(ValueType::UndefinedType) {} - explicit SerializableScalar(std::nullptr_t) : Serializable(ValueType::NullType) {} + SerializableScalar() : Serializable(UndefinedType) {} + explicit SerializableScalar(std::nullptr_t) : Serializable(NullType) {} - jsi::Value toJSValue(jsi::Runtime &) override; + jsi::Value toJSValue(jsi::Runtime &); protected: union Data { @@ -396,7 +452,7 @@ class SerializableTurboModuleLike : public Serializable { jsi::Runtime &rt, const jsi::Object &object, const std::shared_ptr &proto) - : Serializable(ValueType::TurboModuleLikeType), + : Serializable(TurboModuleLikeType), proto_(std::make_unique(rt, proto)), properties_(std::make_unique(rt, object)) {} @@ -407,25 +463,4 @@ class SerializableTurboModuleLike : public Serializable { const std::unique_ptr properties_; }; -jsi::Function getCustomSerializableUnpacker(jsi::Runtime &rt); - -class CustomSerializable : public Serializable { - public: - CustomSerializable(std::shared_ptr data, const int typeId) - : Serializable(ValueType::CustomType), data_(std::move(data)), typeId_(typeId) {} - - jsi::Value toJSValue(jsi::Runtime &rt) override; - - private: - const std::shared_ptr data_; - const int typeId_; -}; - -struct SerializationData { - std::shared_ptr determine; - std::shared_ptr pack; - std::shared_ptr unpack; - int typeId; -}; - } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.cpp index 5d89d993..46c37faa 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.cpp @@ -1,7 +1,6 @@ #include #include -#include #include namespace worklets { @@ -33,7 +32,8 @@ void Synchronizable::setBlocking(const std::shared_ptr &value) { jsi::Value Synchronizable::toJSValue(jsi::Runtime &rt) { auto synchronizableUnpacker = getSynchronizableUnpacker(rt); - auto ref = SerializableJSRef::newNativeStateObject(rt, this->shared_from_this()); + auto ref = + SerializableJSRef::newNativeStateObject(rt, this->shared_from_this()); return synchronizableUnpacker.call(rt, std::move(ref)); } @@ -41,17 +41,25 @@ Synchronizable::Synchronizable(const std::shared_ptr &value) : Serializable(ValueType::SynchronizableType), value_(value) {} jsi::Function getSynchronizableUnpacker(jsi::Runtime &rt) { - auto synchronizableUnpacker = rt.global().getProperty(rt, "__synchronizableUnpacker"); - react_native_assert(synchronizableUnpacker.isObject() && "synchronizableUnpacker not found"); + auto synchronizableUnpacker = + rt.global().getProperty(rt, "__synchronizableUnpacker"); + react_native_assert( + synchronizableUnpacker.isObject() && "synchronizableUnpacker not found"); return synchronizableUnpacker.asObject(rt).asFunction(rt); } -std::shared_ptr extractSynchronizableOrThrow(jsi::Runtime &rt, const jsi::Value &value) { - auto serializable = - extractSerializableOrThrow(rt, value, "[Worklets] Expecting the object to be of type SerializableJSRef."); +std::shared_ptr extractSynchronizableOrThrow( + jsi::Runtime &rt, + const jsi::Value &value) { + auto serializable = extractSerializableOrThrow( + rt, + value, + "[Worklets] Expecting the object to be of type SerializableJSRef."); auto synchronizable = std::dynamic_pointer_cast(serializable); - react_native_assert(synchronizable != nullptr && "[Worklets] Expected the object to be a Synchronizable."); + react_native_assert( + synchronizable != nullptr && + "[Worklets] Expected the object to be a Synchronizable."); return synchronizable; } diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.h index 55e3a56e..65229c23 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.h @@ -44,7 +44,7 @@ class Synchronizable : public SynchronizableAccess, explicit Synchronizable(const std::shared_ptr &value); - ~Synchronizable() override = default; + virtual ~Synchronizable() = default; private: std::shared_ptr value_; @@ -52,6 +52,8 @@ class Synchronizable : public SynchronizableAccess, jsi::Function getSynchronizableUnpacker(jsi::Runtime &rt); -std::shared_ptr extractSynchronizableOrThrow(jsi::Runtime &rt, const jsi::Value &value); +std::shared_ptr extractSynchronizableOrThrow( + jsi::Runtime &rt, + const jsi::Value &value); }; // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/SynchronizableAccess.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/SynchronizableAccess.cpp index 97b98389..c107192d 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/SynchronizableAccess.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/SharedItems/SynchronizableAccess.cpp @@ -6,7 +6,8 @@ namespace worklets { void SynchronizableAccess::getBlockingBefore() { std::unique_lock lock(accessLock_); queue_.wait(lock, [this]() { - return !blockingWriter_ /* && dirtyWriters_ == 0 */ && (!imperativelyLocked_ || imperativeOwner_ == pthread_self()); + return !blockingWriter_ /* && dirtyWriters_ == 0 */ && + (!imperativelyLocked_ || imperativeOwner_ == pthread_self()); }); blockingReaders_++; } @@ -43,7 +44,8 @@ void SynchronizableAccess::getBlockingAfter() { void SynchronizableAccess::setBlockingBefore() { std::unique_lock lock(accessLock_); queue_.wait(lock, [this]() { - return !blockingWriter_ && blockingReaders_ == 0 /* && dirtyWriters_ == 0 */ && + return !blockingWriter_ && + blockingReaders_ == 0 /* && dirtyWriters_ == 0 */ && (!imperativelyLocked_ || imperativeOwner_ == pthread_self()); }); blockingWriter_ = true; @@ -58,7 +60,8 @@ void SynchronizableAccess::setBlockingAfter() { void SynchronizableAccess::lock() { std::unique_lock lock(accessLock_); queue_.wait(lock, [this]() { - return !blockingWriter_ && blockingReaders_ == 0 /* && dirtyWriters_ == 0 */ && + return !blockingWriter_ && + blockingReaders_ == 0 /* && dirtyWriters_ == 0 */ && (!imperativelyLocked_ || imperativeOwner_ == pthread_self()); }); imperativelyLocked_ = true; diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/Defs.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/Defs.h index 43516a66..fccf8f6f 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/Defs.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/Defs.h @@ -8,15 +8,3 @@ so we have to check if headers are available. #if __APPLE__ && __has_include() #define JS_RUNTIME_HERMES 1 #endif - -#if REACT_NATIVE_MINOR_VERSION >= 84 -#include -namespace worklets { -using JSBigStringBuffer = facebook::react::JSBigString; -} -#else -#include -namespace worklets { -using JSBigStringBuffer = facebook::react::BigStringBuffer; -} -#endif // REACT_NATIVE_MINOR_VERSION >= 84 diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/FeatureFlags.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/FeatureFlags.cpp index 74fcaa1c..f5fe837d 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/FeatureFlags.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/FeatureFlags.cpp @@ -1,8 +1,5 @@ #include -#include -#include - namespace worklets { std::unordered_map DynamicFeatureFlags::flags_; diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSISerializer.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSISerializer.cpp index b4c6fa5a..2669e47a 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSISerializer.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSISerializer.cpp @@ -1,11 +1,8 @@ #include #include - #include #include -#include -#include namespace worklets { @@ -63,23 +60,39 @@ const std::vector SUPPORTED_REFLECTION_TYPES = { "Proxy", }; -static inline std::string getObjectTypeName(jsi::Runtime &rt, const jsi::Object &object) { - return object.getPropertyAsObject(rt, "constructor").getProperty(rt, "name").toString(rt).utf8(rt); +static inline std::string getObjectTypeName( + jsi::Runtime &rt, + const jsi::Object &object) { + return object.getPropertyAsObject(rt, "constructor") + .getProperty(rt, "name") + .toString(rt) + .utf8(rt); } -static inline bool isInstanceOf(jsi::Runtime &rt, const jsi::Object &object, const std::string &type) { +static inline bool isInstanceOf( + jsi::Runtime &rt, + const jsi::Object &object, + const std::string &type) { return getObjectTypeName(rt, object) == type; } -static inline bool -isInstanceOfAny(jsi::Runtime &rt, const jsi::Object &object, const std::vector &supportedTypes) { +static inline bool isInstanceOfAny( + jsi::Runtime &rt, + const jsi::Object &object, + const std::vector &supportedTypes) { auto instanceType = getObjectTypeName(rt, object); - return std::find(supportedTypes.begin(), supportedTypes.end(), instanceType) != supportedTypes.end(); + return std::find( + supportedTypes.begin(), supportedTypes.end(), instanceType) != + supportedTypes.end(); } JSISerializer::JSISerializer(jsi::Runtime &rt) - : rt_(rt), visitedNodes_(rt_.global().getPropertyAsFunction(rt_, "Set").callAsConstructor(rt_).asObject(rt_)) {} + : rt_(rt), + visitedNodes_(rt_.global() + .getPropertyAsFunction(rt_, "Set") + .callAsConstructor(rt_) + .asObject(rt_)) {} std::string JSISerializer::stringifyWithName(const jsi::Object &object) { std::stringstream ss; @@ -117,7 +130,8 @@ std::string JSISerializer::stringifyFunction(const jsi::Function &func) { std::string JSISerializer::stringifyHostObject(jsi::HostObject &hostObject) { int status = -1; - char *hostObjClassName = abi::__cxa_demangle(typeid(hostObject).name(), NULL, NULL, &status); + char *hostObjClassName = + abi::__cxa_demangle(typeid(hostObject).name(), NULL, NULL, &status); if (status != 0) { return "[jsi::HostObject]"; } @@ -135,7 +149,8 @@ std::string JSISerializer::stringifyHostObject(jsi::HostObject &hostObject) { for (const auto &key : props) { auto formattedKey = key.utf8(rt_); auto value = hostObject.get(rt_, key); - ss << '"' << formattedKey << '"' << ": " << stringifyJSIValueRecursively(value); + ss << '"' << formattedKey << '"' << ": " + << stringifyJSIValueRecursively(value); if (formattedKey != lastKey) { ss << ", "; } @@ -155,7 +170,8 @@ std::string JSISerializer::stringifyObject(const jsi::Object &object) { for (size_t i = 0, propsCount = props.size(rt_); i < propsCount; i++) { jsi::String propName = props.getValueAtIndex(rt_, i).toString(rt_); - ss << '"' << propName.utf8(rt_) << '"' << ": " << stringifyJSIValueRecursively(object.getProperty(rt_, propName)); + ss << '"' << propName.utf8(rt_) << '"' << ": " + << stringifyJSIValueRecursively(object.getProperty(rt_, propName)); if (i != propsCount - 1) { ss << ", "; } @@ -175,7 +191,9 @@ std::string JSISerializer::stringifyError(const jsi::Object &object) { std::string JSISerializer::stringifySet(const jsi::Object &object) { std::stringstream ss; - jsi::Function arrayFrom = rt_.global().getPropertyAsObject(rt_, "Array").getPropertyAsFunction(rt_, "from"); + jsi::Function arrayFrom = rt_.global() + .getPropertyAsObject(rt_, "Array") + .getPropertyAsFunction(rt_, "from"); jsi::Object result = arrayFrom.call(rt_, object).asObject(rt_); if (!result.isArray(rt_)) { @@ -199,7 +217,9 @@ std::string JSISerializer::stringifySet(const jsi::Object &object) { std::string JSISerializer::stringifyMap(const jsi::Object &object) { std::stringstream ss; - jsi::Function arrayFrom = rt_.global().getPropertyAsObject(rt_, "Array").getPropertyAsFunction(rt_, "from"); + jsi::Function arrayFrom = rt_.global() + .getPropertyAsObject(rt_, "Array") + .getPropertyAsFunction(rt_, "from"); jsi::Object result = arrayFrom.call(rt_, object).asObject(rt_); if (!result.isArray(rt_)) { @@ -213,7 +233,8 @@ std::string JSISerializer::stringifyMap(const jsi::Object &object) { auto pair = arr.getValueAtIndex(rt_, i).asObject(rt_).getArray(rt_); auto key = pair.getValueAtIndex(rt_, 0); auto value = pair.getValueAtIndex(rt_, 1); - ss << stringifyJSIValueRecursively(key) << ": " << stringifyJSIValueRecursively(value); + ss << stringifyJSIValueRecursively(key) << ": " + << stringifyJSIValueRecursively(value); if (i != length - 1) { ss << ", "; } @@ -237,15 +258,21 @@ std::string JSISerializer::stringifyRecursiveType(const jsi::Object &object) { } std::string JSISerializer::stringifyWithToString(const jsi::Object &object) { - return object.getPropertyAsFunction(rt_, "toString").callWithThis(rt_, object).toString(rt_).utf8(rt_); + return object.getPropertyAsFunction(rt_, "toString") + .callWithThis(rt_, object) + .toString(rt_) + .utf8(rt_); } -std::string JSISerializer::stringifyJSIValueRecursively(const jsi::Value &value, bool isTopLevel) { +std::string JSISerializer::stringifyJSIValueRecursively( + const jsi::Value &value, + bool isTopLevel) { if (value.isBool() || value.isNumber()) { return value.toString(rt_).utf8(rt_); } if (value.isString()) { - return isTopLevel ? value.getString(rt_).utf8(rt_) : '"' + value.getString(rt_).utf8(rt_) + '"'; + return isTopLevel ? value.getString(rt_).utf8(rt_) + : '"' + value.getString(rt_).utf8(rt_) + '"'; } if (value.isSymbol()) { return value.getSymbol(rt_).toString(rt_); @@ -283,12 +310,15 @@ std::string JSISerializer::stringifyJSIValueRecursively(const jsi::Value &value, isInstanceOfAny(rt_, object, SUPPORTED_STRUCTURED_DATA_TYPES) || isInstanceOfAny(rt_, object, SUPPORTED_MANAGING_MEMORY_TYPES) || isInstanceOfAny(rt_, object, SUPPORTED_ABSTRACTION_OBJECT_TYPES) || - isInstanceOfAny(rt_, object, SUPPORTED_REFLECTION_TYPES) || isInstanceOf(rt_, object, "Intl") || - isInstanceOf(rt_, object, "WeakMap") || isInstanceOf(rt_, object, "WeakSet")) { + isInstanceOfAny(rt_, object, SUPPORTED_REFLECTION_TYPES) || + isInstanceOf(rt_, object, "Intl") || + isInstanceOf(rt_, object, "WeakMap") || + isInstanceOf(rt_, object, "WeakSet")) { // TODO: Consider extending this log info return stringifyWithName(object); } - if (isInstanceOf(rt_, object, "Date") || isInstanceOf(rt_, object, "RegExp")) { + if (isInstanceOf(rt_, object, "Date") || + isInstanceOf(rt_, object, "RegExp")) { return stringifyWithToString(object); } if (isInstanceOf(rt_, object, "Map")) { diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSISerializer.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSISerializer.h index 1c5288a1..55b509c6 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSISerializer.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSISerializer.h @@ -11,7 +11,9 @@ namespace worklets { class JSISerializer { public: explicit JSISerializer(jsi::Runtime &rt); - std::string stringifyJSIValueRecursively(const jsi::Value &value, bool isTopLevel = false); + std::string stringifyJSIValueRecursively( + const jsi::Value &value, + bool isTopLevel = false); private: std::string stringifyArray(const jsi::Array &arr); @@ -26,11 +28,14 @@ class JSISerializer { std::string stringifyRecursiveType(const jsi::Object &object); bool hasBeenVisited(const jsi::Object &object) { - return visitedNodes_.getPropertyAsFunction(rt_, "has").callWithThis(rt_, visitedNodes_, object).getBool(); + return visitedNodes_.getPropertyAsFunction(rt_, "has") + .callWithThis(rt_, visitedNodes_, object) + .getBool(); } void markAsVisited(const jsi::Object &object) { - visitedNodes_.getPropertyAsFunction(rt_, "add").callWithThis(rt_, visitedNodes_, object); + visitedNodes_.getPropertyAsFunction(rt_, "add") + .callWithThis(rt_, visitedNodes_, object); } jsi::Runtime &rt_; diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSLogger.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSLogger.cpp index 2d98e9b2..b3b8ee3b 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSLogger.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSLogger.cpp @@ -1,7 +1,6 @@ #include #include -#include #include namespace worklets { @@ -20,7 +19,8 @@ void JSLogger::reportFatalErrorOnJS( const std::shared_ptr &jsScheduler, JSErrorData &&jsErrorData, bool force) { - auto job = [jsErrorData = std::move(jsErrorData), force](jsi::Runtime &rnRuntime) { + auto job = [jsErrorData = std::move(jsErrorData), + force](jsi::Runtime &rnRuntime) { reportFatalErrorOnJS(rnRuntime, jsErrorData, force); }; if (jsScheduler->canInvokeSyncOnJS()) { @@ -30,20 +30,38 @@ void JSLogger::reportFatalErrorOnJS( } } -void JSLogger::reportFatalErrorOnJS(jsi::Runtime &rnRuntime, const JSErrorData &jsErrorData, bool force) { +void JSLogger::reportFatalErrorOnJS( + jsi::Runtime &rnRuntime, + const JSErrorData &jsErrorData, + bool force) { const auto &global = rnRuntime.global(); - const auto errorInstance = - rnRuntime.global().getPropertyAsFunction(rnRuntime, "Error").callAsConstructor(rnRuntime).asObject(rnRuntime); + const auto errorInstance = rnRuntime.global() + .getPropertyAsFunction(rnRuntime, "Error") + .callAsConstructor(rnRuntime) + .asObject(rnRuntime); - errorInstance.setProperty(rnRuntime, "message", jsi::String::createFromUtf8(rnRuntime, jsErrorData.message)); + errorInstance.setProperty( + rnRuntime, + "message", + jsi::String::createFromUtf8(rnRuntime, jsErrorData.message)); - errorInstance.setProperty(rnRuntime, "stack", jsi::String::createFromUtf8(rnRuntime, jsErrorData.stack)); + errorInstance.setProperty( + rnRuntime, + "stack", + jsi::String::createFromUtf8(rnRuntime, jsErrorData.stack)); - errorInstance.setProperty(rnRuntime, "name", jsi::String::createFromUtf8(rnRuntime, jsErrorData.name)); + errorInstance.setProperty( + rnRuntime, + "name", + jsi::String::createFromUtf8(rnRuntime, jsErrorData.name)); - errorInstance.setProperty(rnRuntime, "jsEngine", jsi::String::createFromUtf8(rnRuntime, jsErrorData.jsEngine)); + errorInstance.setProperty( + rnRuntime, + "jsEngine", + jsi::String::createFromUtf8(rnRuntime, jsErrorData.jsEngine)); - const auto &reportFatalErrorFunction = global.getPropertyAsFunction(rnRuntime, "__reportFatalRemoteError"); + const auto &reportFatalErrorFunction = + global.getPropertyAsFunction(rnRuntime, "__reportFatalRemoteError"); reportFatalErrorFunction.call(rnRuntime, errorInstance, force); } diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSLogger.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSLogger.h index 08c586a5..9a420ead 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSLogger.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSLogger.h @@ -16,14 +16,20 @@ struct JSErrorData { class JSLogger { public: - explicit JSLogger(const std::shared_ptr &jsScheduler) : jsScheduler_(jsScheduler) {} + explicit JSLogger(const std::shared_ptr &jsScheduler) + : jsScheduler_(jsScheduler) {} void warnOnJS(const std::string &warning) const; - static void - reportFatalErrorOnJS(const std::shared_ptr &jsScheduler, JSErrorData &&jsErrorData, bool force = false); + static void reportFatalErrorOnJS( + const std::shared_ptr &jsScheduler, + JSErrorData &&jsErrorData, + bool force = false); private: - static void reportFatalErrorOnJS(jsi::Runtime &rnRuntime, const JSErrorData &jsErrorData, bool force = false); + static void reportFatalErrorOnJS( + jsi::Runtime &rnRuntime, + const JSErrorData &jsErrorData, + bool force = false); const std::shared_ptr jsScheduler_; }; diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSScheduler.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSScheduler.cpp index 43c80519..2641f9e7 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSScheduler.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSScheduler.cpp @@ -6,15 +6,18 @@ namespace worklets { void JSScheduler::scheduleOnJS(Job job) { - jsCallInvoker_->invokeAsync([job = std::move(job), &rt = rnRuntime_] { job(rt); }); + jsCallInvoker_->invokeAsync( + [job = std::move(job), &rt = rnRuntime_] { job(rt); }); } bool JSScheduler::canInvokeSyncOnJS() { return isJavaScriptQueue_(); } -void JSScheduler::invokeSyncOnJS(const Job &job) { - react_native_assert(canInvokeSyncOnJS() && "JSScheduler::invokeSyncOnJS should only be called from the JS thread"); +void JSScheduler::invokeSyncOnJS(Job job) { + react_native_assert( + canInvokeSyncOnJS() && + "JSScheduler::invokeSyncOnJS should only be called from the JS thread"); job(rnRuntime_); } diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSScheduler.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSScheduler.h index 6a7ac992..a03493f8 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSScheduler.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/JSScheduler.h @@ -18,11 +18,13 @@ class JSScheduler { jsi::Runtime &rnRuntime, const std::shared_ptr &jsCallInvoker, std::function &&isJavaScriptQueue) - : rnRuntime_(rnRuntime), jsCallInvoker_(jsCallInvoker), isJavaScriptQueue_(isJavaScriptQueue) {} + : rnRuntime_(rnRuntime), + jsCallInvoker_(jsCallInvoker), + isJavaScriptQueue_(isJavaScriptQueue) {} void scheduleOnJS(std::function job); - void invokeSyncOnJS(const std::function &job); + void invokeSyncOnJS(std::function job); bool canInvokeSyncOnJS(); diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/SingleInstanceChecker.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/SingleInstanceChecker.h index 4a2fde82..6017613b 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/SingleInstanceChecker.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/SingleInstanceChecker.h @@ -28,7 +28,7 @@ class SingleInstanceChecker { ~SingleInstanceChecker(); private: - void assertWithMessage(bool condition, const std::string &message) { + void assertWithMessage(bool condition, std::string message) { if (!condition) { #ifdef ANDROID __android_log_print(ANDROID_LOG_WARN, "Worklets", "%s", message.c_str()); @@ -50,7 +50,8 @@ class SingleInstanceChecker { template SingleInstanceChecker::SingleInstanceChecker() { int status = 0; - std::string className = __cxxabiv1::__cxa_demangle(typeid(T).name(), nullptr, nullptr, &status); + std::string className = + __cxxabiv1::__cxa_demangle(typeid(T).name(), nullptr, nullptr, &status); // React Native can spawn up to two instances of a Native Module at the same // time. This happens during a reload when a new instance of React Native is diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/VersionUtils.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/VersionUtils.cpp index 41ced947..2f7a032c 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/VersionUtils.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/VersionUtils.cpp @@ -1,9 +1,7 @@ #include #include -#include #include -#include using namespace facebook; @@ -11,7 +9,8 @@ namespace worklets { bool matchVersion(const std::string &version1, const std::string &version2) { std::regex pattern("^\\d+\\.\\d+\\.\\d+$"); - if (std::regex_match(version1, pattern) && std::regex_match(version2, pattern)) { + if (std::regex_match(version1, pattern) && + std::regex_match(version2, pattern)) { auto majorPattern = std::regex("^\\d+"); std::smatch major1; std::smatch major2; @@ -64,7 +63,8 @@ void checkJSVersion( libraryPrefix + "Mismatch between C++ code version and " "JavaScript code version (") + - cppVersion + " vs. " + jsVersion + " respectively).\n" + "See " + docsBaseUrl + + cppVersion + " vs. " + jsVersion + " respectively).\n" + "See " + + docsBaseUrl + "/guides/" "troubleshooting#mismatch-between-c-code-version-and-javascript-code-" "version` for more details."); diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletEventHandler.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletEventHandler.cpp index 74019774..50258455 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletEventHandler.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletEventHandler.cpp @@ -1,15 +1,13 @@ #include -#include -#include - namespace worklets { void WorkletEventHandler::process( const std::shared_ptr &workletRuntime, const double eventTimestamp, const jsi::Value &eventValue) const { - workletRuntime->runSync(handlerFunction_, jsi::Value(eventTimestamp), eventValue); + workletRuntime->runGuarded( + handlerFunction_, jsi::Value(eventTimestamp), eventValue); } uint64_t WorkletEventHandler::getHandlerId() const { diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsJSIUtils.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsJSIUtils.cpp index 1f64e794..0afe87b2 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsJSIUtils.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsJSIUtils.cpp @@ -4,14 +4,16 @@ #include #include -#include #include using namespace facebook; namespace worklets::jsi_utils { -jsi::Array convertStringToArray(jsi::Runtime &rt, const std::string &value, const unsigned int expectedSize) { +jsi::Array convertStringToArray( + jsi::Runtime &rt, + const std::string &value, + const unsigned int expectedSize) { std::vector transformMatrixList; std::istringstream stringStream(value); std::copy( @@ -19,7 +21,8 @@ jsi::Array convertStringToArray(jsi::Runtime &rt, const std::string &value, cons std::istream_iterator(), std::back_inserter(transformMatrixList)); react_native_assert( - transformMatrixList.size() == expectedSize && "Transform matrix list size is different than expected"); + transformMatrixList.size() == expectedSize && + "Transform matrix list size is different than expected"); jsi::Array matrix(rt, expectedSize); for (unsigned int i = 0; i < expectedSize; i++) { matrix.setValueAtIndex(rt, i, transformMatrixList[i]); @@ -27,10 +30,13 @@ jsi::Array convertStringToArray(jsi::Runtime &rt, const std::string &value, cons return matrix; } -jsi::Object optimizedFromHostObject(jsi::Runtime &rt, std::shared_ptr &&hostObject) { +jsi::Object optimizedFromHostObject( + jsi::Runtime &rt, + std::shared_ptr &&hostObject) { auto optimizedObject = jsi::Object(rt); for (const auto &propertyName : hostObject->getPropertyNames(rt)) { - optimizedObject.setProperty(rt, propertyName, hostObject->get(rt, propertyName)); + optimizedObject.setProperty( + rt, propertyName, hostObject->get(rt, propertyName)); } return optimizedObject; } diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsJSIUtils.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsJSIUtils.h index 975819a7..6d0b1d70 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsJSIUtils.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsJSIUtils.h @@ -40,7 +40,9 @@ inline jsi::Object get(jsi::Runtime &rt, const jsi::Value *value) { } template <> -inline jsi::Value const &get(jsi::Runtime &, const jsi::Value *value) { +inline jsi::Value const &get( + jsi::Runtime &, + const jsi::Value *value) { return *value; } @@ -55,7 +57,9 @@ inline jsi::Value const &get(jsi::Runtime &, const jsi::Valu // BEGIN implementations for `convertArgs` specializations. // specialization for empty `Targs` - returns an empty tuple template -inline std::enable_if_t<(sizeof...(Args) == 0), std::tuple<>> convertArgs(jsi::Runtime &, const jsi::Value *) { +inline std::enable_if_t<(sizeof...(Args) == 0), std::tuple<>> convertArgs( + jsi::Runtime &, + const jsi::Value *) { return std::make_tuple(); } @@ -63,7 +67,9 @@ inline std::enable_if_t<(sizeof...(Args) == 0), std::tuple<>> convertArgs(jsi::R // then calls recursively on the rest of `args` // and returns the concatenation of results template -inline std::tuple convertArgs(jsi::Runtime &rt, const jsi::Value *args) { +inline std::tuple convertArgs( + jsi::Runtime &rt, + const jsi::Value *args) { auto arg = std::tuple(get(rt, args)); auto rest = convertArgs(rt, std::next(args)); return std::tuple_cat(std::move(arg), std::move(rest)); @@ -73,9 +79,14 @@ inline std::tuple convertArgs(jsi::Runtime &rt, const jsi::Value *ar // returns a tuple with the result of casting `args` to appropriate // native C++ types needed to call `function` template -std::tuple -getArgsForFunction(std::function, jsi::Runtime &rt, const jsi::Value *args, const size_t count) { - react_native_assert(sizeof...(Args) == count && "Argument list has different length than expected"); +std::tuple getArgsForFunction( + std::function, + jsi::Runtime &rt, + const jsi::Value *args, + const size_t count) { + react_native_assert( + sizeof...(Args) == count && + "Argument list has different length than expected"); return convertArgs(rt, args); } @@ -88,27 +99,36 @@ std::tuple getArgsForFunction( jsi::Runtime &rt, const jsi::Value *args, const size_t count) { - react_native_assert(sizeof...(Args) == count && "Argument list has different length than expected"); + react_native_assert( + sizeof...(Args) == count && + "Argument list has different length than expected"); return std::tuple_cat(std::tie(rt), convertArgs(rt, args)); } // calls `function` with `args` template -inline jsi::Value apply(std::function function, std::tuple args) { +inline jsi::Value apply( + std::function function, + std::tuple args) { return std::apply(function, std::move(args)); } // calls string-returning `function` with `args`, // and returns the string template -inline jsi::Value apply(jsi::Runtime &rt, std::function function, std::tuple args) { +inline jsi::Value apply( + jsi::Runtime &rt, + std::function function, + std::tuple args) { return jsi::String::createFromUtf8(rt, std::apply(function, std::move(args))); } // calls void-returning `function` with `args`, // and returns `undefined` template -inline jsi::Value apply(std::function function, std::tuple args) { +inline jsi::Value apply( + std::function function, + std::tuple args) { std::apply(function, std::move(args)); return jsi::Value::undefined(); } @@ -117,7 +137,11 @@ inline jsi::Value apply(std::function function, std::tuple jsi::HostFunctionType createHostFunction(Fun function) { - return [function](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, const size_t count) { + return [function]( + jsi::Runtime &rt, + const jsi::Value &, + const jsi::Value *args, + const size_t count) { auto argz = getArgsForFunction(function, rt, args, count); return apply(function, std::move(argz)); }; @@ -126,8 +150,13 @@ jsi::HostFunctionType createHostFunction(Fun function) { // returns a function with JSI calling convention // from a native function `function` returning a string template -jsi::HostFunctionType createHostFunction(std::function function) { - return [function](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, const size_t count) { +jsi::HostFunctionType createHostFunction( + std::function function) { + return [function]( + jsi::Runtime &rt, + const jsi::Value &, + const jsi::Value *args, + const size_t count) { auto argz = getArgsForFunction(function, rt, args, count); return apply(rt, function, std::move(argz)); }; @@ -150,11 +179,14 @@ struct takes_runtime { // and installs it as a global function named `name` // in the `rt` JS runtime template -void installJsiFunction(jsi::Runtime &rt, std::string_view name, std::function function) { +void installJsiFunction( + jsi::Runtime &rt, + std::string_view name, + std::function function) { auto clb = createHostFunction(function); auto argsCount = sizeof...(Args) - takes_runtime::value; - jsi::Value jsiFunction = - jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, name.data()), argsCount, clb); + jsi::Value jsiFunction = jsi::Function::createFromHostFunction( + rt, jsi::PropNameID::forAscii(rt, name.data()), argsCount, clb); rt.global().setProperty(rt, name.data(), jsiFunction); } @@ -164,8 +196,13 @@ void installJsiFunction(jsi::Runtime &rt, std::string_view name, Fun function) { installJsiFunction(rt, name, std::function(std::forward(function))); } -jsi::Array convertStringToArray(jsi::Runtime &rt, const std::string &value, const unsigned int expectedSize); +jsi::Array convertStringToArray( + jsi::Runtime &rt, + const std::string &value, + const unsigned int expectedSize); -jsi::Object optimizedFromHostObject(jsi::Runtime &rt, std::shared_ptr &&hostObject); +jsi::Object optimizedFromHostObject( + jsi::Runtime &rt, + std::shared_ptr &&hostObject); } // namespace worklets::jsi_utils diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsSystraceSection.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsSystraceSection.h index 97b7dec2..a66764b4 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsSystraceSection.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsSystraceSection.h @@ -31,7 +31,9 @@ namespace worklets { struct WorkletsSystraceSection { public: template - explicit WorkletsSystraceSection(const char *name, ConvertsToStringPiece &&...args) { + explicit WorkletsSystraceSection( + const char *name, + ConvertsToStringPiece &&...args) { ATrace_beginSection(name); } @@ -43,7 +45,8 @@ struct WorkletsSystraceSection { // The apple part is copied from React Native // from // https://github.com/facebook/react-native/blob/5697d923a05119314b4cfcd556cb243986637764/packages/react-native/ReactCommon/cxxreact/SystraceSection.h -#elif defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES && defined(WORKLETS_PROFILING) +#elif defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES && \ + defined(WORKLETS_PROFILING) template struct renderer { @@ -55,7 +58,8 @@ struct renderer { }; template -static auto render(const T &t) -> decltype(renderer::render(std::declval())) { +static auto render(const T &t) + -> decltype(renderer::render(std::declval())) { return renderer::render(t); } @@ -63,7 +67,8 @@ inline os_log_t instrumentsLogHandle = nullptr; static inline os_log_t getOrCreateInstrumentsLogHandle() { if (!instrumentsLogHandle) { - instrumentsLogHandle = os_log_create("dev.worklets.instruments", OS_LOG_CATEGORY_POINTS_OF_INTEREST); + instrumentsLogHandle = os_log_create( + "dev.worklets.instruments", OS_LOG_CATEGORY_POINTS_OF_INTEREST); } return instrumentsLogHandle; } @@ -71,7 +76,9 @@ static inline os_log_t getOrCreateInstrumentsLogHandle() { struct WorkletsSystraceSection { public: template - explicit WorkletsSystraceSection(const char *name, ConvertsToStringPiece &&...args) { + explicit WorkletsSystraceSection( + const char *name, + ConvertsToStringPiece &&...args) { os_log_t instrumentsLogHandle = worklets::getOrCreateInstrumentsLogHandle(); // If the log isn't enabled, we don't want the performance overhead of the @@ -90,11 +97,22 @@ struct WorkletsSystraceSection { signpostID_ = os_signpost_id_make_with_pointer(instrumentsLogHandle, this); - os_signpost_interval_begin(instrumentsLogHandle, signpostID_, "Worklets", "%s begin: %s", name, argsString.c_str()); + os_signpost_interval_begin( + instrumentsLogHandle, + signpostID_, + "Worklets", + "%s begin: %s", + name, + argsString.c_str()); } ~WorkletsSystraceSection() { - os_signpost_interval_end(worklets::instrumentsLogHandle, signpostID_, "Worklets", "%s end", name_.data()); + os_signpost_interval_end( + worklets::instrumentsLogHandle, + signpostID_, + "Worklets", + "%s end", + name_.data()); } private: @@ -107,10 +125,12 @@ struct WorkletsSystraceSection { struct WorkletsSystraceSection { public: template - explicit WorkletsSystraceSection(const char *name, ConvertsToStringPiece &&...args) {} + explicit WorkletsSystraceSection( + const char *name, + ConvertsToStringPiece &&...args) {} }; -#endif // defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES && \ - // defined(WORKLETS_PROFILING) +#endif // defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES && + // defined(WORKLETS_PROFILING) } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsVersion.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsVersion.cpp index 16b50cee..77d5449a 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsVersion.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsVersion.cpp @@ -21,13 +21,19 @@ std::string getWorkletsCppVersion() { void injectWorkletsCppVersion(jsi::Runtime &rnRuntime) { auto version = getWorkletsCppVersion(); - rnRuntime.global().setProperty(rnRuntime, "_WORKLETS_VERSION_CPP", jsi::String::createFromUtf8(rnRuntime, version)); + rnRuntime.global().setProperty( + rnRuntime, + "_WORKLETS_VERSION_CPP", + jsi::String::createFromUtf8(rnRuntime, version)); } #ifndef NDEBUG -void checkJSVersion(jsi::Runtime &rnRuntime, const std::shared_ptr &jsLogger) { +void checkJSVersion( + jsi::Runtime &rnRuntime, + const std::shared_ptr &jsLogger) { auto cppVersion = getWorkletsCppVersion(); - auto jsVersionValue = rnRuntime.global().getProperty(rnRuntime, "_WORKLETS_VERSION_JS"); + auto jsVersionValue = + rnRuntime.global().getProperty(rnRuntime, "_WORKLETS_VERSION_JS"); worklets::checkJSVersion( rnRuntime, jsVersionValue, @@ -37,7 +43,9 @@ void checkJSVersion(jsi::Runtime &rnRuntime, const std::shared_ptr &jsLogger) { +void checkJSVersion( + jsi::Runtime &rnRuntime, + const std::shared_ptr &jsLogger) { // In release builds we don't check the version, hence // this function is a NOOP. } diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsVersion.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsVersion.h index 62d35d22..832842ec 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsVersion.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/Tools/WorkletsVersion.h @@ -13,6 +13,8 @@ namespace worklets { std::string getWorkletsCppVersion(); void injectWorkletsCppVersion(jsi::Runtime &); -void checkJSVersion(jsi::Runtime &, const std::shared_ptr &); +void checkJSVersion( + jsi::Runtime &, + const std::shared_ptr &); }; // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp index b201be74..52b7ec3f 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp @@ -1,10 +1,9 @@ -#include #include #include #include #include - #include + #include namespace worklets { @@ -13,7 +12,10 @@ void RNRuntimeWorkletDecorator::decorate( jsi::Runtime &rnRuntime, jsi::Object &&jsiWorkletsModuleProxy, const std::shared_ptr &jsLogger) { - rnRuntime.global().setProperty(rnRuntime, runtimeKindBindingName, static_cast(RuntimeKind::ReactNative)); + rnRuntime.global().setProperty( + rnRuntime, + runtimeKindBindingName, + static_cast(RuntimeKind::ReactNative)); rnRuntime.global().setProperty(rnRuntime, "_WORKLET", false); @@ -21,7 +23,8 @@ void RNRuntimeWorkletDecorator::decorate( // react-native-screens 4.9.0 depends on it rnRuntime.global().setProperty(rnRuntime, "_IS_FABRIC", true); - rnRuntime.global().setProperty(rnRuntime, "__workletsModuleProxy", std::move(jsiWorkletsModuleProxy)); + rnRuntime.global().setProperty( + rnRuntime, "__workletsModuleProxy", std::move(jsiWorkletsModuleProxy)); WorkletRuntimeCollector::install(rnRuntime); @@ -29,19 +32,7 @@ void RNRuntimeWorkletDecorator::decorate( checkJSVersion(rnRuntime, jsLogger); #endif // NDEBUG -#ifdef IS_REANIMATED_EXAMPLE_APP - installDebugBindings(rnRuntime); -#endif // IS_REANIMATED_EXAMPLE_APP - injectWorkletsCppVersion(rnRuntime); } -#ifdef IS_REANIMATED_EXAMPLE_APP -void RNRuntimeWorkletDecorator::installDebugBindings(jsi::Runtime &rnRuntime) { - jsi_utils::installJsiFunction(rnRuntime, "__hasNativeState", [](jsi::Runtime &rt, const jsi::Value &value) { - return jsi::Value(value.isObject() && value.asObject(rt).hasNativeState(rt)); - }); -} -#endif // IS_REANIMATED_EXAMPLE_APP - } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h index 8acbeed0..a851f6b7 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h @@ -12,13 +12,10 @@ namespace worklets { class RNRuntimeWorkletDecorator { // TODO: Rename to `RNRuntimeWorkletsDecorator` or something more suitable. public: - static void - decorate(jsi::Runtime &rnRuntime, jsi::Object &&jsiWorkletsModuleProxy, const std::shared_ptr &jsLogger); - -#ifdef IS_REANIMATED_EXAMPLE_APP - private: - static void installDebugBindings(jsi::Runtime &rnRuntime); -#endif // IS_REANIMATED_EXAMPLE_APP + static void decorate( + jsi::Runtime &rnRuntime, + jsi::Object &&jsiWorkletsModuleProxy, + const std::shared_ptr &jsLogger); }; } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeBindings.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeBindings.h deleted file mode 100644 index 688487eb..00000000 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeBindings.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include - -#include - -using namespace facebook; - -namespace worklets { - -struct RuntimeBindings { - using RequestAnimationFrame = std::function)>; - - const RequestAnimationFrame requestAnimationFrame; -}; - -} // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeData.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeData.cpp index 55a50765..c2e9fe3c 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeData.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeData.cpp @@ -1,11 +1,3 @@ #include -#include - -namespace worklets { -namespace RuntimeData { - const std::string uiRuntimeName{"UI"}; - -} // namespace RuntimeData -} // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeData.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeData.h index a4fce174..5efcf647 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeData.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeData.h @@ -1,23 +1,10 @@ #pragma once -#include #include -namespace worklets { -namespace RuntimeData { - /** * Unused, but kept for possible future use. */ constexpr uint64_t rnRuntimeId{0}; constexpr uint64_t uiRuntimeId{1}; extern const std::string uiRuntimeName; - -#if REACT_NATIVE_MINOR_VERSION >= 81 - -constexpr facebook::jsi::UUID weakRuntimeUUID{0x770c6f2e, 0x1e4d, 0x436a, 0xa2b1, 0x9f322c8d5f5e}; - -#endif // REACT_NATIVE_MINOR_VERSION >= 81 - -}; // namespace RuntimeData -} // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeHolder.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeHolder.h deleted file mode 100644 index 1e3f4439..00000000 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeHolder.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once -#if REACT_NATIVE_MINOR_VERSION >= 81 - -#include - -namespace worklets { - -class WorkletRuntime; - -/** - * Holds a weak reference to a WorkletRuntime instance. - * - * Used to link jsi::Runtime instances back to their WorkletRuntime holders - * without inducing reference cycles. - */ -struct WeakRuntimeHolder { - std::weak_ptr weakRuntime; -}; - -} // namespace worklets - -#endif // REACT_NATIVE_MINOR_VERSION >= 81 diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeKind.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeKind.h index 21777d9b..b2bdb825 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeKind.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeKind.h @@ -1,13 +1,11 @@ #pragma once -#include - namespace worklets { /** * Represents the different types of runtime environments available for * worklets. */ -enum class RuntimeKind : std::uint8_t { +enum class RuntimeKind { ReactNative = 1, UI = 2, Worker = 3, diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.cpp index b9ba9dc6..08b1caf5 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.cpp @@ -1,10 +1,7 @@ #include #include -#include -#include #include -#include namespace worklets { @@ -16,6 +13,26 @@ std::shared_ptr RuntimeManager::getRuntime(uint64_t runtimeId) { return nullptr; } +std::shared_ptr RuntimeManager::getRuntime( + const std::string &name) { + std::shared_lock lock(weakRuntimesMutex_); + if (nameToRuntimeId_.contains(name)) { + return getRuntime(nameToRuntimeId_.at(name)); + } + return nullptr; +} + +#ifdef WORKLETS_BUNDLE_MODE +std::shared_ptr RuntimeManager::getRuntime( + jsi::Runtime *runtime) { + std::shared_lock lock(weakRuntimesMutex_); + if (runtimeAddressToRuntimeId_.contains(runtime)) { + return getRuntime(runtimeAddressToRuntimeId_.at(runtime)); + } + return nullptr; +} +#endif // WORKLETS_BUNDLE_MODE + std::vector> RuntimeManager::getAllRuntimes() { std::shared_lock lock(weakRuntimesMutex_); @@ -32,27 +49,28 @@ std::vector> RuntimeManager::getAllRuntimes() { } std::shared_ptr RuntimeManager::getUIRuntime() { - return getRuntime(RuntimeData::uiRuntimeId); + return getRuntime(uiRuntimeId); } std::shared_ptr RuntimeManager::createWorkletRuntime( std::shared_ptr jsiWorkletsModuleProxy, const std::string &name, - const std::shared_ptr &initializer, + std::shared_ptr initializer, const std::shared_ptr &queue, bool enableEventLoop) { const auto runtimeId = getNextRuntimeId(); const auto jsQueue = jsiWorkletsModuleProxy->getJSQueue(); - auto workletRuntime = std::make_shared(runtimeId, jsQueue, name, queue, enableEventLoop); + auto workletRuntime = std::make_shared( + runtimeId, jsQueue, name, queue, enableEventLoop); workletRuntime->init(std::move(jsiWorkletsModuleProxy)); if (initializer) { - workletRuntime->runSync(initializer); + workletRuntime->runGuarded(initializer); } - registerRuntime(runtimeId, workletRuntime); + registerRuntime(runtimeId, name, workletRuntime); return workletRuntime; } @@ -61,13 +79,9 @@ std::shared_ptr RuntimeManager::createUninitializedUIRuntime( const std::shared_ptr &jsQueue, const std::shared_ptr &uiAsyncQueue) { const auto uiRuntime = std::make_shared( - RuntimeData::uiRuntimeId, - jsQueue, - RuntimeData::uiRuntimeName, - uiAsyncQueue, - /*enableEventLoop*/ false); + uiRuntimeId, jsQueue, uiRuntimeName, uiAsyncQueue); - registerRuntime(RuntimeData::uiRuntimeId, uiRuntime); + registerRuntime(uiRuntimeId, uiRuntimeName, uiRuntime); return uiRuntime; } @@ -76,18 +90,16 @@ uint64_t RuntimeManager::getNextRuntimeId() { return nextRuntimeId_.fetch_add(1, std::memory_order_relaxed); } -void RuntimeManager::registerRuntime(const uint64_t runtimeId, const std::shared_ptr &workletRuntime) { - std::unique_lock registrationLock(registrationMutex_); +void RuntimeManager::registerRuntime( + const uint64_t runtimeId, + const std::string &name, + const std::shared_ptr &workletRuntime) { std::unique_lock lock(weakRuntimesMutex_); weakRuntimes_[runtimeId] = workletRuntime; -} - -void RuntimeManager::pause() { - registrationMutex_.lock(); -} - -void RuntimeManager::resume() { - registrationMutex_.unlock(); + nameToRuntimeId_[name] = runtimeId; +#ifdef WORKLETS_BUNDLE_MODE + runtimeAddressToRuntimeId_[&workletRuntime->getJSIRuntime()] = runtimeId; +#endif // WORKLETS_BUNDLE_MODE } } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.h index af778476..c6c49371 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.h @@ -23,6 +23,10 @@ class JSIWorkletsModuleProxy; class RuntimeManager { public: std::shared_ptr getRuntime(uint64_t runtimeId); + std::shared_ptr getRuntime(const std::string &name); +#ifdef WORKLETS_BUNDLE_MODE + std::shared_ptr getRuntime(jsi::Runtime *runtime); +#endif // WORKLETS_BUNDLE_MODE std::vector> getAllRuntimes(); @@ -31,7 +35,7 @@ class RuntimeManager { std::shared_ptr createWorkletRuntime( std::shared_ptr jsiWorkletsModuleProxy, const std::string &name, - const std::shared_ptr &initializer = nullptr, + std::shared_ptr initializer = nullptr, const std::shared_ptr &queue = nullptr, bool enableEventLoop = true); @@ -39,21 +43,21 @@ class RuntimeManager { const std::shared_ptr &jsQueue, const std::shared_ptr &uiAsyncQueue); - /** Pauses registration of new Worklet Runtimes. */ - void pause(); - - /** Resumes registration of new Worklet Runtimes. */ - void resume(); - private: uint64_t getNextRuntimeId(); - void registerRuntime(const uint64_t runtimeId, const std::shared_ptr &workletRuntime); + void registerRuntime( + const uint64_t runtimeId, + const std::string &name, + const std::shared_ptr &workletRuntime); - std::atomic_uint64_t nextRuntimeId_{RuntimeData::uiRuntimeId + 1}; + std::atomic_uint64_t nextRuntimeId_{uiRuntimeId + 1}; std::map> weakRuntimes_; std::shared_mutex weakRuntimesMutex_; - std::mutex registrationMutex_; + std::map nameToRuntimeId_; +#ifdef WORKLETS_BUNDLE_MODE + std::map runtimeAddressToRuntimeId_; +#endif // WORKLETS_BUNDLE_MODE }; } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/UIRuntimeDecorator.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/UIRuntimeDecorator.cpp index 2337198d..0c0de55e 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/UIRuntimeDecorator.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/UIRuntimeDecorator.cpp @@ -8,12 +8,16 @@ namespace worklets { void UIRuntimeDecorator::decorate( facebook::jsi::Runtime &uiRuntime, - std::function &&requestAnimationFrame) { - uiRuntime.global().setProperty(uiRuntime, runtimeKindBindingName, static_cast(RuntimeKind::UI)); + std::function< + void(facebook::jsi::Runtime &rt, const facebook::jsi::Value &callback)> + &&requestAnimationFrame) { + uiRuntime.global().setProperty( + uiRuntime, runtimeKindBindingName, static_cast(RuntimeKind::UI)); uiRuntime.global().setProperty(uiRuntime, "_UI", true); - jsi_utils::installJsiFunction(uiRuntime, "requestAnimationFrame", std::move(requestAnimationFrame)); + jsi_utils::installJsiFunction( + uiRuntime, "requestAnimationFrame", std::move(requestAnimationFrame)); } } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/UIRuntimeDecorator.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/UIRuntimeDecorator.h index 717d6c9a..b26e45ea 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/UIRuntimeDecorator.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/UIRuntimeDecorator.h @@ -8,7 +8,9 @@ class UIRuntimeDecorator { public: static void decorate( facebook::jsi::Runtime &uiRuntime, - std::function &&requestAnimationFrame); + std::function &&requestAnimationFrame); }; } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.cpp index 22388b6b..1ac9612a 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.cpp @@ -16,29 +16,25 @@ namespace worklets { using namespace facebook; using namespace react; -#if HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) +#if HERMES_ENABLE_DEBUGGER using namespace facebook::hermes::inspector_modern; -#endif // HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) +#endif // HERMES_ENABLE_DEBUGGER #if HERMES_ENABLE_DEBUGGER -class HermesExecutorRuntimeAdapter -#if HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) - : public RuntimeAdapter -#endif // HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) -{ +class HermesExecutorRuntimeAdapter : public RuntimeAdapter { public: explicit HermesExecutorRuntimeAdapter( facebook::hermes::HermesRuntime &hermesRuntime, const std::shared_ptr &thread) - : hermesRuntime_(hermesRuntime), thread_(thread) {} + : hermesRuntime_(hermesRuntime), thread_(std::move(thread)) {} virtual ~HermesExecutorRuntimeAdapter() { // This is required by iOS, because there is an assertion in the destructor // that the thread was indeed `quit` before thread_->quitSynchronous(); } -#if HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) + facebook::hermes::HermesRuntime &getRuntime() override { return hermesRuntime_; } @@ -48,7 +44,6 @@ class HermesExecutorRuntimeAdapter // required us to hold a refernce to the runtime inside this adapter which // caused issues while reloading the app. void tickleJs() override {} -#endif // HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) public: facebook::hermes::HermesRuntime &hermesRuntime_; @@ -61,11 +56,15 @@ WorkletHermesRuntime::WorkletHermesRuntime( std::unique_ptr runtime, const std::shared_ptr &jsQueue, const std::string &name) - : jsi::WithRuntimeDecorator(*runtime, reentrancyCheck_), runtime_(std::move(runtime)) { -#if HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) - auto adapter = std::make_unique(*runtime_, jsQueue); + : jsi::WithRuntimeDecorator( + *runtime, + reentrancyCheck_), + runtime_(std::move(runtime)) { +#if HERMES_ENABLE_DEBUGGER + auto adapter = + std::make_unique(*runtime_, jsQueue); debugToken_ = chrome::enableDebugging(std::move(adapter), name); -#endif // HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) +#endif // HERMES_ENABLE_DEBUGGER #ifndef NDEBUG facebook::hermes::HermesRuntime *wrappedRuntime = runtime_.get(); @@ -74,27 +73,34 @@ WorkletHermesRuntime::WorkletHermesRuntime( jsi::PropNameID::forAscii(*runtime_, "evalWithSourceMap"), 3, [wrappedRuntime]( - jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) -> jsi::Value { - auto code = std::make_shared(args[0].asString(rt).utf8(rt)); + jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) -> jsi::Value { + auto code = std::make_shared( + args[0].asString(rt).utf8(rt)); std::string sourceURL; if (count > 1 && args[1].isString()) { sourceURL = args[1].asString(rt).utf8(rt); } std::shared_ptr sourceMap; if (count > 2 && args[2].isString()) { - sourceMap = std::make_shared(args[2].asString(rt).utf8(rt)); + sourceMap = std::make_shared( + args[2].asString(rt).utf8(rt)); } - return wrappedRuntime->evaluateJavaScriptWithSourceMap(code, sourceMap, sourceURL); + return wrappedRuntime->evaluateJavaScriptWithSourceMap( + code, sourceMap, sourceURL); }); - runtime_->global().setProperty(*runtime_, "evalWithSourceMap", evalWithSourceMap); + runtime_->global().setProperty( + *runtime_, "evalWithSourceMap", evalWithSourceMap); #endif // NDEBUG } WorkletHermesRuntime::~WorkletHermesRuntime() { -#if HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) +#if HERMES_ENABLE_DEBUGGER // We have to disable debugging before the runtime is destroyed. chrome::disableDebugging(debugToken_); -#endif // HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) +#endif // HERMES_ENABLE_DEBUGGER } } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.h index 199327ef..de4301c8 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.h @@ -17,17 +17,17 @@ #include #include -#if HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) +#if HERMES_ENABLE_DEBUGGER #include -#endif // HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) +#endif // HERMES_ENABLE_DEBUGGER namespace worklets { using namespace facebook; using namespace react; -#if HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) +#if HERMES_ENABLE_DEBUGGER using namespace facebook::hermes::inspector_modern; -#endif // HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) +#endif // HERMES_ENABLE_DEBUGGER // ReentrancyCheck is copied from React Native // from ReactCommon/hermes/executor/HermesExecutorFactory.cpp @@ -57,17 +57,20 @@ struct WorkletsReentrancyCheck { // of this sort would be surprising, because the decorator would // need to call after() without before(). - if (tid.compare_exchange_strong(expected, this_id, std::memory_order_relaxed)) { + if (tid.compare_exchange_strong( + expected, this_id, std::memory_order_relaxed)) { // Returns true if tid and expected were the same. If they // were, then the stored tid referred to no thread, and we // atomically saved this thread's tid. Now increment depth. - react_native_assert(depth == 0 && "[Worklets] No thread id, but depth != 0"); + react_native_assert( + depth == 0 && "[Worklets] No thread id, but depth != 0"); ++depth; } else if (expected == this_id) { // If the stored tid referred to a thread, expected was set to // that value. If that value is this thread's tid, that's ok, // just increment depth again. - react_native_assert(depth != 0 && "[Worklets] Thread id was set, but depth == 0"); + react_native_assert( + depth != 0 && "[Worklets] Thread id was set, but depth == 0"); ++depth; } else { // The stored tid was some other thread. This indicates a bad @@ -80,12 +83,15 @@ struct WorkletsReentrancyCheck { void after() { react_native_assert( - tid.load(std::memory_order_relaxed) == std::this_thread::get_id() && "[Worklets] No thread id in after()"); + tid.load(std::memory_order_relaxed) == std::this_thread::get_id() && + "[Worklets] No thread id in after()"); if (--depth == 0) { // If we decremented depth to zero, store no-thread into tid. std::thread::id expected = std::this_thread::get_id(); - bool didWrite = tid.compare_exchange_strong(expected, std::thread::id(), std::memory_order_relaxed); - react_native_assert(didWrite && "[Worklets] Decremented to zero, but no tid write"); + bool didWrite = tid.compare_exchange_strong( + expected, std::thread::id(), std::memory_order_relaxed); + react_native_assert( + didWrite && "[Worklets] Decremented to zero, but no tid write"); } } @@ -103,20 +109,21 @@ struct WorkletsReentrancyCheck { // WithRuntimeDecorator -> DecoratedRuntime -> jsi::Runtime You can find out // more about this in ReactCommon/jsi/jsi/Decorator.h or by following this link: // https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/jsi/jsi/decorator.h -class WorkletHermesRuntime : public jsi::WithRuntimeDecorator { +class WorkletHermesRuntime + : public jsi::WithRuntimeDecorator { public: WorkletHermesRuntime( std::unique_ptr runtime, const std::shared_ptr &jsQueue, const std::string &name); - ~WorkletHermesRuntime() override; + ~WorkletHermesRuntime(); private: std::unique_ptr runtime_; WorkletsReentrancyCheck reentrancyCheck_; -#if HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) +#if HERMES_ENABLE_DEBUGGER chrome::DebugSessionToken debugToken_; -#endif // HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) +#endif // HERMES_ENABLE_DEBUGGER }; } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp index f9ded288..5e863500 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include @@ -14,9 +13,7 @@ #include #include -#include #include -#include #if JS_RUNTIME_HERMES #include @@ -30,7 +27,8 @@ class AroundLock { const std::shared_ptr mutex_; public: - explicit AroundLock(const std::shared_ptr &mutex) : mutex_(mutex) {} + explicit AroundLock(const std::shared_ptr &mutex) + : mutex_(mutex) {} void before() const { mutex_->lock(); @@ -61,7 +59,8 @@ static std::shared_ptr makeRuntime( std::shared_ptr jsiRuntime; #if JS_RUNTIME_HERMES auto hermesRuntime = facebook::hermes::makeHermesRuntime(); - jsiRuntime = std::make_shared(std::move(hermesRuntime), jsQueue, name); + jsiRuntime = std::make_shared( + std::move(hermesRuntime), jsQueue, name); #else jsiRuntime = facebook::jsc::makeJSCRuntime(); #endif @@ -82,37 +81,37 @@ WorkletRuntime::WorkletRuntime( queue_(queue) { jsi::Runtime &rt = *runtime_; WorkletRuntimeCollector::install(rt); - if (enableEventLoop) { + if (enableEventLoop && name != uiRuntimeName) { eventLoop_ = std::make_shared(name_, runtime_, queue_); eventLoop_->run(); } } -void WorkletRuntime::init(std::shared_ptr jsiWorkletsModuleProxy) { +void WorkletRuntime::init( + std::shared_ptr jsiWorkletsModuleProxy) { jsi::Runtime &rt = *runtime_; - -#if REACT_NATIVE_MINOR_VERSION >= 81 - rt.setRuntimeData( - RuntimeData::weakRuntimeUUID, - std::make_shared(WeakRuntimeHolder{.weakRuntime = weak_from_this()})); -#endif // REACT_NATIVE_MINOR_VERSION >= 81 - const auto jsScheduler = jsiWorkletsModuleProxy->getJSScheduler(); const auto isDevBundle = jsiWorkletsModuleProxy->isDevBundle(); - const auto memoryManager_ = jsiWorkletsModuleProxy->getMemoryManager(); #ifdef WORKLETS_BUNDLE_MODE auto script = jsiWorkletsModuleProxy->getScript(); const auto &sourceUrl = jsiWorkletsModuleProxy->getSourceUrl(); #endif // WORKLETS_BUNDLE_MODE - auto optimizedJsiWorkletsModuleProxy = jsi_utils::optimizedFromHostObject(rt, std::move(jsiWorkletsModuleProxy)); + auto optimizedJsiWorkletsModuleProxy = + jsi_utils::optimizedFromHostObject(rt, std::move(jsiWorkletsModuleProxy)); WorkletRuntimeDecorator::decorate( - rt, name_, jsScheduler, isDevBundle, std::move(optimizedJsiWorkletsModuleProxy), eventLoop_); + rt, + name_, + jsScheduler, + isDevBundle, + std::move(optimizedJsiWorkletsModuleProxy), + eventLoop_); #ifdef WORKLETS_BUNDLE_MODE if (!script) { - throw std::runtime_error("[Worklets] Expected to receive the bundle, but got nullptr instead."); + throw std::runtime_error( + "[Worklets] Expected to receive the bundle, but got nullptr instead."); } try { @@ -121,99 +120,87 @@ void WorkletRuntime::init(std::shared_ptr jsiWorkletsMod const auto &message = error.getMessage(); const auto &stack = error.getStack(); if (!message.starts_with("[Worklets] Worklets initialized successfully")) { - const auto newMessage = "[Worklets] Failed to initialize runtime. Reason: " + message; + const auto newMessage = + "[Worklets] Failed to initialize runtime. Reason: " + message; JSLogger::reportFatalErrorOnJS( - jsScheduler, {.message = newMessage, .stack = stack, .name = "WorkletsError", .jsEngine = "Worklets"}); + jsScheduler, + {.message = newMessage, + .stack = stack, + .name = "WorkletsError", + .jsEngine = "Worklets"}); } } #else // Legacy behavior - auto valueUnpackerBuffer = std::make_shared(ValueUnpackerCode); + auto valueUnpackerBuffer = + std::make_shared(ValueUnpackerCode); rt.evaluateJavaScript(valueUnpackerBuffer, "valueUnpacker"); - auto synchronizableUnpackerBuffer = std::make_shared(SynchronizableUnpackerCode); + auto synchronizableUnpackerBuffer = + std::make_shared(SynchronizableUnpackerCode); rt.evaluateJavaScript(synchronizableUnpackerBuffer, "synchronizableUnpacker"); - - auto customSerializableUnpackerBuffer = std::make_shared(CustomSerializableUnpackerCode); - rt.evaluateJavaScript(customSerializableUnpackerBuffer, "customSerializableUnpacker"); #endif // WORKLETS_BUNDLE_MODE - try { - memoryManager_->loadAllCustomSerializables(shared_from_this()); - } catch (jsi::JSError &e) { - throw std::runtime_error(std::string("[Worklets] Failed to load custom serializables. Reason: ") + e.getMessage()); - } } -/* #region schedule */ - -void WorkletRuntime::schedule(jsi::Function &&function) const { +void WorkletRuntime::runAsyncGuarded( + const std::shared_ptr &worklet) { react_native_assert( - queue_ && - "[Worklets] Tried to invoke `schedule` on a Worklet Runtime but the " - "async queue is not set. Recreate the runtime with a valid async queue."); - queue_->push([function = std::make_shared(std::move(function)), weakThis = weak_from_this()]() { + "[Worklets] Tried to invoke `runAsyncGuarded` on a Worklet Runtime but " + "the async queue is not set. Recreate the runtime with a valid async queue."); + + queue_->push([worklet, weakThis = weak_from_this()] { auto strongThis = weakThis.lock(); if (!strongThis) { return; } - strongThis->runSync(*function); + strongThis->runGuarded(worklet); }); } -void WorkletRuntime::schedule(std::shared_ptr worklet) const { - react_native_assert( - queue_ && - "[Worklets] Tried to invoke `schedule` on a Worklet Runtime but the " - "async queue is not set. Recreate the runtime with a valid async queue."); - - queue_->push([worklet = std::move(worklet), weakThis = weak_from_this()] { - auto strongThis = weakThis.lock(); - if (!strongThis) { - return; - } - - strongThis->runSync(worklet); - }); +jsi::Value WorkletRuntime::executeSync( + jsi::Runtime &rt, + const jsi::Value &worklet) const { + auto serializableWorklet = extractSerializableOrThrow( + rt, + worklet, + "[Worklets] Only worklets can be executed synchronously on UI runtime."); + auto lock = std::unique_lock(*runtimeMutex_); + jsi::Runtime &uiRuntime = getJSIRuntime(); + auto result = runGuarded(serializableWorklet); + auto serializableResult = extractSerializableOrThrow(uiRuntime, result); + lock.unlock(); + return serializableResult->toJSValue(rt); } -void WorkletRuntime::schedule(std::function job) const { - react_native_assert( - queue_ && - "[Worklets] Tried to invoke `schedule` on a Worklet Runtime but the " - "async queue is not set. Recreate the runtime with a valid async queue."); - - queue_->push(std::move(job)); +#ifdef WORKLETS_BUNDLE_MODE +jsi::Value WorkletRuntime::executeSync( + std::function &&job) const { + auto lock = std::unique_lock(*runtimeMutex_); + jsi::Runtime &uiRuntime = getJSIRuntime(); + return job(uiRuntime); } -void WorkletRuntime::schedule(std::function job) const { - react_native_assert( - queue_ && - "[Worklets] Tried to invoke `schedule` on a Worklet Runtime but the " - "async queue is not set. Recreate the runtime with a valid async queue."); - - queue_->push([job = std::move(job), weakThis = weak_from_this()]() { - auto strongThis = weakThis.lock(); - if (!strongThis) { - return; - } - - auto lock = std::unique_lock(*strongThis->runtimeMutex_); - jsi::Runtime &runtime = strongThis->getJSIRuntime(); - job(runtime); - }); +jsi::Value WorkletRuntime::executeSync( + const std::function &job) const { + auto lock = std::unique_lock(*runtimeMutex_); + jsi::Runtime &uiRuntime = getJSIRuntime(); + return job(uiRuntime); } +#endif // WORKLETS_BUNDLE_MODE -/* #endregion */ - -jsi::Value WorkletRuntime::get(jsi::Runtime &rt, const jsi::PropNameID &propName) { +jsi::Value WorkletRuntime::get( + jsi::Runtime &rt, + const jsi::PropNameID &propName) { auto name = propName.utf8(rt); if (name == "toString") { return jsi::Function::createFromHostFunction( rt, propName, 0, - [weakThis = weak_from_this()](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *, size_t) -> jsi::Value { + [weakThis = weak_from_this()]( + jsi::Runtime &rt, const jsi::Value &, const jsi::Value *, size_t) + -> jsi::Value { auto strongThis = weakThis.lock(); if (!strongThis) { return jsi::String::createFromUtf8(rt, ""); @@ -228,14 +215,17 @@ jsi::Value WorkletRuntime::get(jsi::Runtime &rt, const jsi::PropNameID &propName return jsi::Value::undefined(); } -std::vector WorkletRuntime::getPropertyNames(jsi::Runtime &rt) { +std::vector WorkletRuntime::getPropertyNames( + jsi::Runtime &rt) { std::vector result; result.push_back(jsi::PropNameID::forUtf8(rt, "toString")); result.push_back(jsi::PropNameID::forUtf8(rt, "name")); return result; } -std::shared_ptr extractWorkletRuntime(jsi::Runtime &rt, const jsi::Value &value) { +std::shared_ptr extractWorkletRuntime( + jsi::Runtime &rt, + const jsi::Value &value) { return value.getObject(rt).getHostObject(rt); } @@ -248,68 +238,7 @@ void scheduleOnRuntime( rt, serializableWorkletValue, "[Worklets] Function passed to `_scheduleOnRuntime` is not a serializable worklet."); - workletRuntime->schedule(serializableWorklet); + workletRuntime->runAsyncGuarded(serializableWorklet); } -#if REACT_NATIVE_MINOR_VERSION >= 81 -std::weak_ptr WorkletRuntime::getWeakRuntimeFromJSIRuntime(jsi::Runtime &rt) { - auto runtimeData = rt.getRuntimeData(RuntimeData::weakRuntimeUUID); - if (!runtimeData) [[unlikely]] { - throw std::runtime_error( - "[Worklets] No weak runtime data found on the provided JSI runtime." - " Perhaps the JSI Runtime is not a WorkletRuntime?"); - } - auto weakHolder = std::static_pointer_cast(runtimeData); - return weakHolder->weakRuntime; -} -#endif // REACT_NATIVE_MINOR_VERSION >= 81 - -/* #region deprecated */ - -void WorkletRuntime::runAsyncGuarded(const std::shared_ptr &worklet) { - schedule(worklet); -} - -jsi::Value WorkletRuntime::executeSync(jsi::Runtime &caller, const jsi::Value &worklet) const { - auto serializableWorklet = extractSerializableOrThrow( - caller, worklet, "[Worklets] Only worklets can be executed synchronously on UI runtime."); - auto result = runSyncSerialized(serializableWorklet); - return result->toJSValue(caller); -} - -jsi::Value WorkletRuntime::executeSync(std::function &&job) const { - return runSync(job); -} - -jsi::Value WorkletRuntime::executeSync(const std::function &job) const { - return runSync(job); -} - -#ifndef NDEBUG -static const auto callGuardLambda = [](facebook::jsi::Runtime &rt, - const facebook::jsi::Value &thisVal, - const facebook::jsi::Value *args, - size_t count) { - return args[0].asObject(rt).asFunction(rt).call(rt, args + 1, count - 1); -}; - -jsi::Function WorkletRuntime::getCallGuard(jsi::Runtime &rt) { - auto callGuard = rt.global().getProperty(rt, "__callGuardDEV"); - if (callGuard.isObject()) { - // Use JS implementation if `__callGuardDEV` has already been installed. - // This is the desired behavior. - return callGuard.asObject(rt).asFunction(rt); - } - - // Otherwise, fallback to C++ JSI implementation. This is necessary so that we - // can install `__callGuardDEV` itself and should happen only once. Note that - // the C++ implementation doesn't intercept errors and simply throws them as - // C++ exceptions which crashes the app. We assume that installing the guard - // doesn't throw any errors. - return jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, "callGuard"), 1, callGuardLambda); -} -#endif // NDEBUG - -/* #endregion */ - } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h index 715c7009..7d6761b5 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include @@ -14,7 +14,6 @@ #include #include -#include #include #include @@ -23,111 +22,14 @@ using namespace react; namespace worklets { -template -concept ImplicitlySerializableCallable = std::is_assignable_v || - std::is_assignable_v &, TCallable>; - -template -concept RuntimeCallable = requires(TCallable &&callable, jsi::Runtime &rt) { - // NOLINTNEXTLINE(readability/braces) cpplint doesn't understand concepts - { callable(rt) }; -} || ImplicitlySerializableCallable; - /** * Forward declaration to avoid circular dependencies. */ class JSIWorkletsModuleProxy; -class WorkletRuntime : public jsi::HostObject, public std::enable_shared_from_this { +class WorkletRuntime : public jsi::HostObject, + public std::enable_shared_from_this { public: - void schedule(jsi::Function &&function) const; - void schedule(std::shared_ptr worklet) const; - void schedule(std::function job) const; - void schedule(std::function job) const; - - /* #region runSync */ - - template - std::invoke_result_t runSync(TCallable &&callable, Args &&...args) const; - template - jsi::Value runSync(const jsi::Function &function, Args &&...args) const { - auto &rt = *runtime_; - // We only use callGuard in debug mode, otherwise we call the provided - // function directly. CallGuard provides a way of capturing exceptions in - // JavaScript and propagating them to the main React Native thread such that - // they can be presented using RN's LogBox. -#ifndef NDEBUG - return getCallGuard(rt).call(rt, function, args...); -#else - return function.call(rt, args...); -#endif // NDEBUG - } - template - jsi::Value runSync(const std::shared_ptr &worklet, Args &&...args) const { - jsi::Runtime &rt = *runtime_; - return runSync(worklet->toJSValue(rt).asObject(rt).asFunction(rt), std::forward(args)...); - } - template - std::invoke_result_t runSync(TCallable &&job) const { - jsi::Runtime &rt = getJSIRuntime(); - auto lock = std::unique_lock(*runtimeMutex_); - return job(rt); - } - - /* #endregion */ - - /* #region runSyncSerialized */ - - template - std::shared_ptr runSyncSerialized(TCallable &&callable, Args &&...args) const; - template - std::shared_ptr runSyncSerialized(const jsi::Function &function, Args &&...args) const { - jsi::Runtime &rt = getJSIRuntime(); - auto lock = std::unique_lock(*runtimeMutex_); - auto result = runSync(function, std::forward(args)...); - auto serializableResult = extractSerializableOrThrow( - rt, - result, - "[Worklets] Function passed to `runSyncSerialized`" - "must return a value serialized with `createSerializable`."); - return serializableResult; - } - template - std::shared_ptr runSyncSerialized(const std::shared_ptr &worklet, Args &&...args) - const { - jsi::Runtime &rt = getJSIRuntime(); - auto lock = std::unique_lock(*runtimeMutex_); - auto result = runSync(worklet, std::forward(args)...); - auto serializableResult = extractSerializableOrThrow( - rt, - result, - "[Worklets] Worklet passed to `runSyncSerialized`" - "must return a value serialized with `createSerializable`."); - return serializableResult; - } - - /* #endregion */ - - jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override; - - std::vector getPropertyNames(jsi::Runtime &rt) override; - - [[nodiscard]] std::string toString() const noexcept { - return "[WorkletRuntime \"" + name_ + "\"]"; - } - - [[nodiscard]] jsi::Runtime &getJSIRuntime() const noexcept { - return *runtime_; - } - - [[nodiscard]] uint64_t getRuntimeId() const noexcept { - return runtimeId_; - } - - [[nodiscard]] std::string getRuntimeName() const noexcept { - return name_; - } - explicit WorkletRuntime( uint64_t runtimeId, const std::shared_ptr &jsQueue, @@ -137,40 +39,45 @@ class WorkletRuntime : public jsi::HostObject, public std::enable_shared_from_th void init(std::shared_ptr jsiWorkletsModuleProxy); - /* #region deprecated */ + jsi::Runtime &getJSIRuntime() const { + return *runtime_; + } - /** @deprecated Use `runSync` instead. */ template - jsi::Value runGuarded(const std::shared_ptr &worklet, Args &&...args) const { - return runSync(worklet, std::forward(args)...); + inline jsi::Value runGuarded( + const std::shared_ptr &serializableWorklet, + Args &&...args) const { + jsi::Runtime &rt = *runtime_; + return runOnRuntimeGuarded( + rt, serializableWorklet->toJSValue(rt), std::forward(args)...); } - /** @deprecated Use `schedule` instead. */ void runAsyncGuarded(const std::shared_ptr &worklet); - /** @deprecated Use `runSyncSerialized` and extract to `jsi::Value` with - * `extractSerializableOrThrow` instead. */ jsi::Value executeSync(jsi::Runtime &rt, const jsi::Value &worklet) const; - /** @deprecated Use `runSync` instead. */ + +#ifdef WORKLETS_BUNDLE_MODE jsi::Value executeSync(std::function &&job) const; - /** @deprecated Use `runSync` instead. */ - jsi::Value executeSync(const std::function &job) const; - /* #endregion */ + jsi::Value executeSync( + const std::function &job) const; +#endif // WORKLETS_BUNDLE_MODE -#if REACT_NATIVE_MINOR_VERSION >= 81 - /** - * Retrieves a weak reference to the WorkletRuntime associated with the - * provided jsi::Runtime. - * - * Throws when invoked with a non-worklet runtime. - */ - static std::weak_ptr getWeakRuntimeFromJSIRuntime(jsi::Runtime &rt); -#endif // REACT_NATIVE_MINOR_VERSION >= 81 + std::string toString() const { + return "[WorkletRuntime \"" + name_ + "\"]"; + } -#ifndef NDEBUG - static jsi::Function getCallGuard(jsi::Runtime &rt); -#endif // NDEBUG + jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override; + + std::vector getPropertyNames(jsi::Runtime &rt) override; + + [[nodiscard]] auto getRuntimeId() const -> uint64_t { + return runtimeId_; + } + + [[nodiscard]] auto getRuntimeName() const -> std::string { + return name_; + } private: const uint64_t runtimeId_; @@ -183,35 +90,13 @@ class WorkletRuntime : public jsi::HostObject, public std::enable_shared_from_th // This function needs to be non-inline to avoid problems with dynamic_cast on // Android -std::shared_ptr extractWorkletRuntime(jsi::Runtime &rt, const jsi::Value &value); +std::shared_ptr extractWorkletRuntime( + jsi::Runtime &rt, + const jsi::Value &value); void scheduleOnRuntime( jsi::Runtime &rt, const jsi::Value &workletRuntimeValue, const jsi::Value &serializableWorkletValue); -/** - * @deprecated Use `WorkletRuntime::runSync` instead. - */ -template -inline jsi::Value runOnRuntimeGuarded(jsi::Runtime &rt, const jsi::Function &function, Args &&...args) { - // We only use callGuard in debug mode, otherwise we call the provided - // function directly. CallGuard provides a way of capturing exceptions in - // JavaScript and propagating them to the main React Native thread such that - // they can be presented using RN's LogBox. -#ifndef NDEBUG - return WorkletRuntime::getCallGuard(rt).call(rt, function, args...); -#else - return function.call(rt, args...); -#endif // NDEBUG -} - -/** - * @deprecated Use `WorkletRuntime::runSync` instead. - */ -template -inline jsi::Value runOnRuntimeGuarded(jsi::Runtime &rt, const jsi::Value &function, Args &&...args) { - return runOnRuntimeGuarded(rt, function.asObject(rt).asFunction(rt), std::forward(args)...); -} - } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h index 47d3b40d..09c70913 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h @@ -19,7 +19,7 @@ class WorkletRuntimeCollector : public jsi::HostObject { WorkletRuntimeRegistry::registerRuntime(runtime_); } - ~WorkletRuntimeCollector() override { + ~WorkletRuntimeCollector() { WorkletRuntimeRegistry::unregisterRuntime(runtime_); } diff --git a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp index d64c0464..32df7d57 100644 --- a/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +++ b/frontend-admin/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp @@ -6,8 +6,6 @@ #include #include -#include -#include #include #include @@ -16,7 +14,9 @@ namespace worklets { static inline double performanceNow() { // copied from JSExecutor.cpp auto time = std::chrono::steady_clock::now(); - auto duration = std::chrono::duration_cast(time.time_since_epoch()).count(); + auto duration = std::chrono::duration_cast( + time.time_since_epoch()) + .count(); constexpr double NANOSECONDS_IN_MILLISECOND = 1000000.0; return duration / NANOSECONDS_IN_MILLISECOND; @@ -24,7 +24,7 @@ static inline double performanceNow() { static inline std::vector parseArgs( jsi::Runtime &rt, - const std::shared_ptr &serializableArgs) { + std::shared_ptr serializableArgs) { if (serializableArgs == nullptr) { return {}; } @@ -48,7 +48,8 @@ void WorkletRuntimeDecorator::decorate( // resolves "ReferenceError: Property 'global' doesn't exist at ..." rt.global().setProperty(rt, "global", rt.global()); - rt.global().setProperty(rt, runtimeKindBindingName, static_cast(RuntimeKind::Worker)); + rt.global().setProperty( + rt, runtimeKindBindingName, static_cast(RuntimeKind::Worker)); rt.global().setProperty(rt, "_WORKLET", true); @@ -60,12 +61,16 @@ void WorkletRuntimeDecorator::decorate( rt.global().setProperty(rt, "__DEV__", isDevBundle); - rt.global().setProperty(rt, "__workletsModuleProxy", std::move(jsiWorkletsModuleProxy)); + rt.global().setProperty( + rt, "__workletsModuleProxy", std::move(jsiWorkletsModuleProxy)); #ifndef NDEBUG - auto evalWithSourceUrl = - [](jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) -> jsi::Value { - auto code = std::make_shared(args[0].asString(rt).utf8(rt)); + auto evalWithSourceUrl = [](jsi::Runtime &rt, + const jsi::Value &thisValue, + const jsi::Value *args, + size_t count) -> jsi::Value { + auto code = std::make_shared( + args[0].asString(rt).utf8(rt)); std::string url; if (count > 1 && args[1].isString()) { url = args[1].asString(rt).utf8(rt); @@ -76,51 +81,85 @@ void WorkletRuntimeDecorator::decorate( rt, "evalWithSourceUrl", jsi::Function::createFromHostFunction( - rt, jsi::PropNameID::forAscii(rt, "evalWithSourceUrl"), 1, evalWithSourceUrl)); + rt, + jsi::PropNameID::forAscii(rt, "evalWithSourceUrl"), + 1, + evalWithSourceUrl)); #endif // NDEBUG jsi_utils::installJsiFunction( - rt, "_log", [](jsi::Runtime &rt, const jsi::Value &value) { PlatformLogger::log(stringifyJSIValue(rt, value)); }); - - jsi_utils::installJsiFunction(rt, "_toString", [](jsi::Runtime &rt, const jsi::Value &value) { - return jsi::String::createFromUtf8(rt, stringifyJSIValue(rt, value)); - }); - - jsi_utils::installJsiFunction( - rt, "_createSerializable", [](jsi::Runtime &rt, const jsi::Value &value, const jsi::Value &nativeStateSource) { - auto shouldRetainRemote = jsi::Value::undefined(); - return makeSerializableClone(rt, value, shouldRetainRemote, nativeStateSource); + rt, "_log", [](jsi::Runtime &rt, const jsi::Value &value) { + PlatformLogger::log(stringifyJSIValue(rt, value)); }); - jsi_utils::installJsiFunction(rt, "_createSerializableHostObject", [](jsi::Runtime &rt, const jsi::Value &value) { - return makeSerializableHostObject(rt, value.asObject(rt).asHostObject(rt)); - }); - - jsi_utils::installJsiFunction(rt, "_createSerializableString", [](jsi::Runtime &rt, const jsi::Value &value) { - return makeSerializableString(rt, value.asString(rt)); - }); - - jsi_utils::installJsiFunction(rt, "_createSerializableNumber", [](jsi::Runtime &rt, const jsi::Value &value) { - return makeSerializableNumber(rt, value.asNumber()); - }); - - jsi_utils::installJsiFunction(rt, "_createSerializableBoolean", [](jsi::Runtime &rt, const jsi::Value &value) { - return makeSerializableBoolean(rt, value.asBool()); - }); - - jsi_utils::installJsiFunction(rt, "_createSerializableBigInt", [](jsi::Runtime &rt, const jsi::Value &value) { - return makeSerializableBigInt(rt, value.asBigInt(rt)); - }); + jsi_utils::installJsiFunction( + rt, "_toString", [](jsi::Runtime &rt, const jsi::Value &value) { + return jsi::String::createFromUtf8(rt, stringifyJSIValue(rt, value)); + }); jsi_utils::installJsiFunction( - rt, "_createSerializableUndefined", [](jsi::Runtime &rt) { return makeSerializableUndefined(rt); }); - - jsi_utils::installJsiFunction(rt, "_createSerializableArray", [](jsi::Runtime &rt, const jsi::Value &value) { - return makeSerializableArray(rt, value.asObject(rt).asArray(rt), false); - }); + rt, + "_createSerializable", + [](jsi::Runtime &rt, + const jsi::Value &value, + const jsi::Value &nativeStateSource) { + auto shouldRetainRemote = jsi::Value::undefined(); + return makeSerializableClone( + rt, value, shouldRetainRemote, nativeStateSource); + }); jsi_utils::installJsiFunction( - rt, "_createSerializableNull", [](jsi::Runtime &rt) { return makeSerializableNull(rt); }); + rt, + "_createSerializableHostObject", + [](jsi::Runtime &rt, const jsi::Value &value) { + return makeSerializableHostObject( + rt, value.asObject(rt).asHostObject(rt)); + }); + + jsi_utils::installJsiFunction( + rt, + "_createSerializableString", + [](jsi::Runtime &rt, const jsi::Value &value) { + return makeSerializableString(rt, value.asString(rt)); + }); + + jsi_utils::installJsiFunction( + rt, + "_createSerializableNumber", + [](jsi::Runtime &rt, const jsi::Value &value) { + return makeSerializableNumber(rt, value.asNumber()); + }); + + jsi_utils::installJsiFunction( + rt, + "_createSerializableBoolean", + [](jsi::Runtime &rt, const jsi::Value &value) { + return makeSerializableBoolean(rt, value.asBool()); + }); + + jsi_utils::installJsiFunction( + rt, + "_createSerializableBigInt", + [](jsi::Runtime &rt, const jsi::Value &value) { + return makeSerializableBigInt(rt, value.asBigInt(rt)); + }); + + jsi_utils::installJsiFunction( + rt, "_createSerializableUndefined", [](jsi::Runtime &rt) { + return makeSerializableUndefined(rt); + }); + + jsi_utils::installJsiFunction( + rt, + "_createSerializableArray", + [](jsi::Runtime &rt, const jsi::Value &value) { + return makeSerializableArray(rt, value.asObject(rt).asArray(rt), false); + }); + + jsi_utils::installJsiFunction( + rt, "_createSerializableNull", [](jsi::Runtime &rt) { + return makeSerializableNull(rt); + }); jsi_utils::installJsiFunction( rt, @@ -129,46 +168,70 @@ void WorkletRuntimeDecorator::decorate( const jsi::Value &value, const jsi::Value &shouldRetainRemote, const jsi::Value &nativeStateSource) { - return makeSerializableObject(rt, value.getObject(rt), shouldRetainRemote.getBool(), nativeStateSource); + return makeSerializableObject( + rt, + value.getObject(rt), + shouldRetainRemote.getBool(), + nativeStateSource); }); - jsi_utils::installJsiFunction(rt, "_createSerializableWorklet", [](jsi::Runtime &rt, const jsi::Value &value) { - return makeSerializableWorklet(rt, value.asObject(rt), false); - }); + jsi_utils::installJsiFunction( + rt, + "_createSerializableWorklet", + [](jsi::Runtime &rt, const jsi::Value &value) { + return makeSerializableWorklet(rt, value.asObject(rt), false); + }); - jsi_utils::installJsiFunction(rt, "_createSerializableInitializer", [](jsi::Runtime &rt, const jsi::Value &value) { - return makeSerializableInitializer(rt, value.asObject(rt)); - }); + jsi_utils::installJsiFunction( + rt, + "_createSerializableInitializer", + [](jsi::Runtime &rt, const jsi::Value &value) { + return makeSerializableInitializer(rt, value.asObject(rt)); + }); - jsi_utils::installJsiFunction(rt, "_createSerializableFunction", [](jsi::Runtime &rt, const jsi::Value &value) { - return makeSerializableFunction(rt, value.asObject(rt).asFunction(rt)); - }); + jsi_utils::installJsiFunction( + rt, + "_createSerializableFunction", + [](jsi::Runtime &rt, const jsi::Value &value) { + return makeSerializableFunction(rt, value.asObject(rt).asFunction(rt)); + }); - jsi_utils::installJsiFunction(rt, "_createSerializableSynchronizable", [](jsi::Runtime &rt, const jsi::Value &value) { - return SerializableJSRef::newNativeStateObject(rt, extractSerializableOrThrow(rt, value)); - }); + jsi_utils::installJsiFunction( + rt, + "_createSerializableSynchronizable", + [](jsi::Runtime &rt, const jsi::Value &value) { + return SerializableJSRef::newNativeStateObject( + rt, extractSerializableOrThrow(rt, value)); + }); jsi_utils::installJsiFunction( rt, "_scheduleRemoteFunctionOnJS", - [jsScheduler](jsi::Runtime &rt, const jsi::Value &funValue, const jsi::Value &argsValue) { - auto serializableRemoteFun = extractSerializableOrThrow( + [jsScheduler]( + jsi::Runtime &rt, + const jsi::Value &funValue, + const jsi::Value &argsValue) { + auto serializableRemoteFun = extractSerializableOrThrow< + SerializableRemoteFunction>( rt, funValue, "[Worklets] Incompatible object passed to scheduleOnJS. It is only allowed to schedule worklets or functions defined on the React Native JS runtime this way."); auto serializableArgs = argsValue.isUndefined() ? nullptr - : extractSerializableOrThrow(rt, argsValue, "[Worklets] Args must be an array."); + : extractSerializableOrThrow( + rt, argsValue, "[Worklets] Args must be an array."); jsScheduler->scheduleOnJS([=](jsi::Runtime &rt) { - auto fun = serializableRemoteFun->toJSValue(rt).asObject(rt).asFunction(rt); + auto fun = + serializableRemoteFun->toJSValue(rt).asObject(rt).asFunction(rt); if (serializableArgs == nullptr) { // fast path for remote function w/o arguments fun.call(rt); } else { auto args = parseArgs(rt, serializableArgs); - fun.call(rt, const_cast(args.data()), args.size()); + fun.call( + rt, const_cast(args.data()), args.size()); } }); }); @@ -176,23 +239,34 @@ void WorkletRuntimeDecorator::decorate( jsi_utils::installJsiFunction( rt, "_scheduleHostFunctionOnJS", - [jsScheduler](jsi::Runtime &rt, const jsi::Value &hostFunValue, const jsi::Value &argsValue) { - auto hostFun = hostFunValue.asObject(rt).asFunction(rt).getHostFunction(rt); + [jsScheduler]( + jsi::Runtime &rt, + const jsi::Value &hostFunValue, + const jsi::Value &argsValue) { + auto hostFun = + hostFunValue.asObject(rt).asFunction(rt).getHostFunction(rt); auto serializableArgs = argsValue.isUndefined() ? nullptr - : extractSerializableOrThrow(rt, argsValue, "[Worklets] Args must be an array."); + : extractSerializableOrThrow( + rt, argsValue, "[Worklets] Args must be an array."); jsScheduler->scheduleOnJS([=](jsi::Runtime &rt) { auto args = parseArgs(rt, serializableArgs); - hostFun(rt, jsi::Value::undefined(), const_cast(args.data()), args.size()); + hostFun( + rt, + jsi::Value::undefined(), + const_cast(args.data()), + args.size()); }); }); jsi_utils::installJsiFunction( rt, "_scheduleOnRuntime", - [](jsi::Runtime &rt, const jsi::Value &workletRuntimeValue, const jsi::Value &serializableWorkletValue) { + [](jsi::Runtime &rt, + const jsi::Value &workletRuntimeValue, + const jsi::Value &serializableWorkletValue) { scheduleOnRuntime(rt, workletRuntimeValue, serializableWorkletValue); }); @@ -204,20 +278,25 @@ void WorkletRuntimeDecorator::decorate( rt, jsi::PropNameID::forAscii(rt, "now"), 0, - [](jsi::Runtime &runtime, const jsi::Value &, const jsi::Value *args, size_t count) { - return jsi::Value(performanceNow()); - })); + [](jsi::Runtime &runtime, + const jsi::Value &, + const jsi::Value *args, + size_t count) { return jsi::Value(performanceNow()); })); rt.global().setProperty(rt, "performance", performance); jsi_utils::installJsiFunction( rt, "_scheduleTimeoutCallback", [weakEventLoop = std::weak_ptr(eventLoop)]( - jsi::Runtime &rt, const jsi::Value &delayJs, const jsi::Value &handlerIdJs) -> jsi::Value { + jsi::Runtime &rt, + const jsi::Value &delayJs, + const jsi::Value &handlerIdJs) -> jsi::Value { const auto delay = delayJs.asNumber(); const auto handlerId = handlerIdJs.asNumber(); const auto job = [handlerId](jsi::Runtime &rt) { - rt.global().getPropertyAsFunction(rt, "__runTimeoutCallback").call(rt, handlerId); + rt.global() + .getPropertyAsFunction(rt, "__runTimeoutCallback") + .call(rt, handlerId); }; if (auto strongEventLoop = weakEventLoop.lock()) { strongEventLoop->pushTimeout(job, delay); diff --git a/frontend-admin/node_modules/react-native-worklets/RNWorklets.podspec b/frontend-admin/node_modules/react-native-worklets/RNWorklets.podspec index d658b491..2133f86f 100644 --- a/frontend-admin/node_modules/react-native-worklets/RNWorklets.podspec +++ b/frontend-admin/node_modules/react-native-worklets/RNWorklets.podspec @@ -11,8 +11,7 @@ worklets_assert_new_architecture_enabled($new_arch_enabled) ios_min_version = '13.4' feature_flags = "-DWORKLETS_FEATURE_FLAGS=\"#{worklets_get_static_feature_flags()}\"" -version_flags = "-DWORKLETS_VERSION=#{package['version']} -DREACT_NATIVE_MINOR_VERSION=#{$worklets_config[:react_native_minor_version]}" -hermes_v1_flag = ENV['RCT_HERMES_V1_ENABLED'] == '1' ? '-DHERMES_V1_ENABLED' : '' +version_flags = "-DWORKLETS_VERSION=#{package['version']}" Pod::Spec.new do |s| s.name = "RNWorklets" @@ -76,7 +75,7 @@ Pod::Spec.new do |s| "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", "GCC_PREPROCESSOR_DEFINITIONS[config=*Debug*]" => "$(inherited) #{hermes_debug_hidden_flags} #{bundle_mode_flag}", "GCC_PREPROCESSOR_DEFINITIONS[config=*Release*]" => "$(inherited) #{bundle_mode_flag}", - "OTHER_CFLAGS" => "$(inherited) #{feature_flags} #{version_flags} #{hermes_v1_flag}", + "OTHER_CFLAGS" => "$(inherited) #{feature_flags} #{version_flags}", } s.xcconfig = { "HEADER_SEARCH_PATHS" => [ diff --git a/frontend-admin/node_modules/react-native-worklets/android/CMakeLists.txt b/frontend-admin/node_modules/react-native-worklets/android/CMakeLists.txt index 7ce60581..1d949d6b 100644 --- a/frontend-admin/node_modules/react-native-worklets/android/CMakeLists.txt +++ b/frontend-admin/node_modules/react-native-worklets/android/CMakeLists.txt @@ -15,9 +15,8 @@ string( APPEND CMAKE_CXX_FLAGS " -DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}\ - -DWORKLETS_VERSION=${WORKLETS_VERSION}\ - -DWORKLETS_FEATURE_FLAGS=\"${WORKLETS_FEATURE_FLAGS}\"\ - -DHERMES_V1_ENABLED=${HERMES_V1_ENABLED}") + -DWORKLETS_VERSION=${WORKLETS_VERSION}\ + -DWORKLETS_FEATURE_FLAGS=\"${WORKLETS_FEATURE_FLAGS}\"") string(APPEND CMAKE_CXX_FLAGS " -fno-omit-frame-pointer -fstack-protector-all") @@ -85,24 +84,41 @@ target_include_directories( "${REACT_NATIVE_DIR}/ReactCommon/react/renderer/graphics/platform/cxx" ) +if(ReactAndroid_VERSION_MINOR LESS 76) + target_link_libraries( + worklets ReactAndroid::fabricjni ReactAndroid::react_debug + ReactAndroid::react_render_core + ReactAndroid::react_render_componentregistry ReactAndroid::rrc_view) +endif() + # build shared lib set_target_properties(worklets PROPERTIES LINKER_LANGUAGE CXX) -target_link_libraries(worklets log ReactAndroid::reactnative ReactAndroid::jsi - fbjni::fbjni) +target_link_libraries(worklets log ReactAndroid::jsi fbjni::fbjni) + +if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) + target_link_libraries(worklets ReactAndroid::reactnative) +else() + target_link_libraries( + worklets ReactAndroid::react_nativemodule_core ReactAndroid::folly_runtime + ReactAndroid::glog ReactAndroid::reactnativejni) +endif() if(${JS_RUNTIME} STREQUAL "hermes") - if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 82) - target_link_libraries(worklets hermes-engine::hermesvm) - else() - target_link_libraries(worklets hermes-engine::libhermes) - endif() + target_link_libraries(worklets hermes-engine::libhermes) if(${HERMES_ENABLE_DEBUGGER}) string(APPEND CMAKE_CXX_FLAGS " -DHERMES_ENABLE_DEBUGGER=1") - - target_link_libraries(worklets ReactAndroid::hermestooling) + if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) + target_link_libraries(worklets ReactAndroid::hermestooling) + else() + target_link_libraries(worklets ReactAndroid::hermes_executor) + endif() endif() elseif(${JS_RUNTIME} STREQUAL "jsc") - target_link_libraries(worklets ReactAndroid::jsctooling) + if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) + target_link_libraries(worklets ReactAndroid::jsctooling) + else() + target_link_libraries(worklets ReactAndroid::jscexecutor) + endif() endif() diff --git a/frontend-admin/node_modules/react-native-worklets/android/build.gradle b/frontend-admin/node_modules/react-native-worklets/android/build.gradle index 61c565b3..021f5bc2 100644 --- a/frontend-admin/node_modules/react-native-worklets/android/build.gradle +++ b/frontend-admin/node_modules/react-native-worklets/android/build.gradle @@ -102,7 +102,6 @@ def IS_NEW_ARCHITECTURE_ENABLED = isNewArchitectureEnabled() def IS_REANIMATED_EXAMPLE_APP = safeAppExtGet("isReanimatedExampleApp", false) def BUNDLE_MODE = safeAppExtGet("workletsBundleMode", false) def WORKLETS_FEATURE_FLAGS = getStaticFeatureFlags() -def HERMES_V1_ENABLED = safeAppExtGet("hermesV1Enabled", false) // Set version for prefab version WORKLETS_VERSION @@ -150,8 +149,6 @@ apply plugin: "com.android.library" apply plugin: "maven-publish" apply plugin: "de.undercouch.download" -apply from: "./fix-prefab.gradle" - android { compileSdkVersion safeExtGet("compileSdkVersion", 34) @@ -199,8 +196,7 @@ android { "-DWORKLETS_BUNDLE_MODE=${BUNDLE_MODE}", "-DWORKLETS_VERSION=${WORKLETS_VERSION}", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON", - "-DWORKLETS_FEATURE_FLAGS=${WORKLETS_FEATURE_FLAGS}", - "-DHERMES_V1_ENABLED=${HERMES_V1_ENABLED}" + "-DWORKLETS_FEATURE_FLAGS=${WORKLETS_FEATURE_FLAGS}" abiFilters (*reactNativeArchitectures()) targets("worklets") } @@ -248,10 +244,19 @@ android { "**/libc++_shared.so", "**/libfbjni.so", "**/libjsi.so", + "**/libfolly_json.so", + "**/libfolly_runtime.so", + "**/libglog.so", "**/libhermes.so", - "**/libhermesvm.so", + "**/libhermes-executor-debug.so", + "**/libhermes_executor.so", "**/libhermestooling.so", + "**/libreactnativejni.so", + "**/libturbomodulejsijni.so", "**/libreactnative.so", + "**/libreact_nativemodule_core.so", + "**/libreact_render*.so", + "**/librrc_root.so", "**/libjscexecutor.so", ] } diff --git a/frontend-admin/node_modules/react-native-worklets/android/fix-prefab.gradle b/frontend-admin/node_modules/react-native-worklets/android/fix-prefab.gradle deleted file mode 100644 index fcf502a0..00000000 --- a/frontend-admin/node_modules/react-native-worklets/android/fix-prefab.gradle +++ /dev/null @@ -1,53 +0,0 @@ -tasks.configureEach { task -> - // Make sure that we generate our prefab publication file only after having built the native library - // so that not a header publication file, but a full configuration publication will be generated, which - // will include the .so file - - def prefabConfigurePattern = ~/^prefab(.+)ConfigurePackage$/ - def matcher = task.name =~ prefabConfigurePattern - if (matcher.matches()) { - def variantName = matcher[0][1] - task.outputs.upToDateWhen { false } - task.dependsOn("externalNativeBuild${variantName}") - } -} - -afterEvaluate { - def abis = reactNativeArchitectures() - rootProject.allprojects.each { proj -> - - if (proj === rootProject) return - - def dependsOnThisLib = proj.configurations.any { config -> - config.dependencies.any { dep -> - dep.group == project.group && dep.name == project.name - } - } - - if (!dependsOnThisLib && proj != project) return - - if (!proj.plugins.hasPlugin('com.android.application') && !proj.plugins.hasPlugin('com.android.library')) { - return - } - - def variants = proj.android.hasProperty('applicationVariants') ? proj.android.applicationVariants : proj.android.libraryVariants - // Touch the prefab_config.json files to ensure that in ExternalNativeJsonGenerator.kt we will re-trigger the prefab CLI to - // generate a libnameConfig.cmake file that will contain our native library (.so). - // See this condition: https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/ExternalNativeJsonGenerator.kt;l=207-219?q=createPrefabBuildSystemGlue - variants.all { variant -> - def variantName = variant.name - abis.each { abi -> - def searchDir = new File(proj.projectDir, ".cxx/${variantName}") - if (!searchDir.exists()) return - def matches = [] - searchDir.eachDir { randomDir -> - def prefabFile = new File(randomDir, "${abi}/prefab_config.json") - if (prefabFile.exists()) matches << prefabFile - } - matches.each { prefabConfig -> - prefabConfig.setLastModified(System.currentTimeMillis()) - } - } - } - } -} diff --git a/frontend-admin/node_modules/react-native-worklets/android/src/experimentalBundling/com/swmansion/worklets/WorkletsModule.java b/frontend-admin/node_modules/react-native-worklets/android/src/experimentalBundling/com/swmansion/worklets/WorkletsModule.java index eba112f3..bd0696b1 100644 --- a/frontend-admin/node_modules/react-native-worklets/android/src/experimentalBundling/com/swmansion/worklets/WorkletsModule.java +++ b/frontend-admin/node_modules/react-native-worklets/android/src/experimentalBundling/com/swmansion/worklets/WorkletsModule.java @@ -3,12 +3,13 @@ package com.swmansion.worklets; import androidx.annotation.OptIn; import com.facebook.jni.HybridData; import com.facebook.proguard.annotations.DoNotStrip; +import com.facebook.react.bridge.BundleConsumer; import com.facebook.react.bridge.LifecycleEventListener; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.queue.MessageQueueThread; import com.facebook.react.common.annotations.FrameworkAPI; -import com.facebook.react.fabric.BundleWrapper; +import com.facebook.react.fabric.BigStringBufferWrapper; import com.facebook.react.module.annotations.ReactModule; import com.facebook.react.turbomodule.core.CallInvokerHolderImpl; import com.facebook.soloader.SoLoader; @@ -19,7 +20,8 @@ import java.util.concurrent.atomic.AtomicBoolean; @SuppressWarnings("JavaJniMissingFunction") @ReactModule(name = WorkletsModule.NAME) -public class WorkletsModule extends NativeWorkletsModuleSpec implements LifecycleEventListener { +public class WorkletsModule extends NativeWorkletsModuleSpec + implements LifecycleEventListener, BundleConsumer { static { SoLoader.loadLibrary("worklets"); } @@ -37,9 +39,19 @@ public class WorkletsModule extends NativeWorkletsModuleSpec implements Lifecycl private final AndroidUIScheduler mAndroidUIScheduler; private final AnimationFrameQueue mAnimationFrameQueue; private boolean mSlowAnimationsEnabled; - private BundleWrapper mBundleWrapper = null; + private BigStringBufferWrapper mScriptWrapper = null; private String mSourceURL = null; + @Override + public void setScriptWrapper(BigStringBufferWrapper scriptWrapper) { + mScriptWrapper = scriptWrapper; + } + + @Override + public void setSourceURL(String sourceURL) { + mSourceURL = sourceURL; + } + /** * Invalidating concurrently could be fatal. It shouldn't happen in a normal flow, but it doesn't * cost us much to add synchronization for extra safety. @@ -52,7 +64,7 @@ public class WorkletsModule extends NativeWorkletsModuleSpec implements Lifecycl MessageQueueThread messageQueueThread, CallInvokerHolderImpl jsCallInvokerHolder, AndroidUIScheduler androidUIScheduler, - BundleWrapper bundleWrapper, + BigStringBufferWrapper scriptWrapper, String sourceURL); public WorkletsModule(ReactApplicationContext reactContext) { @@ -78,16 +90,13 @@ public class WorkletsModule extends NativeWorkletsModuleSpec implements Lifecycl var jsContext = Objects.requireNonNull(context.getJavaScriptContextHolder()).get(); var jsCallInvokerHolder = JSCallInvokerResolver.getJSCallInvokerHolder(context); - mSourceURL = context.getSourceURL(); - mBundleWrapper = context.getBundle(); - mHybridData = initHybrid( jsContext, mMessageQueueThread, jsCallInvokerHolder, mAndroidUIScheduler, - mBundleWrapper, + mScriptWrapper, mSourceURL); return true; } diff --git a/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/AndroidUIScheduler.cpp b/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/AndroidUIScheduler.cpp index 4705b9a6..eb5c44d0 100644 --- a/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/AndroidUIScheduler.cpp +++ b/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/AndroidUIScheduler.cpp @@ -10,7 +10,8 @@ class UISchedulerWrapper : public UIScheduler { jni::global_ref androidUiScheduler_; public: - explicit UISchedulerWrapper(jni::global_ref androidUiScheduler) + explicit UISchedulerWrapper( + jni::global_ref androidUiScheduler) : androidUiScheduler_(androidUiScheduler) {} void scheduleOnUI(std::function job) override { @@ -22,10 +23,14 @@ class UISchedulerWrapper : public UIScheduler { } }; -AndroidUIScheduler::AndroidUIScheduler(jni::alias_ref jThis) - : javaPart_(jni::make_global(jThis)), uiScheduler_(std::make_shared(jni::make_global(jThis))) {} +AndroidUIScheduler::AndroidUIScheduler( + jni::alias_ref jThis) + : javaPart_(jni::make_global(jThis)), + uiScheduler_( + std::make_shared(jni::make_global(jThis))) {} -jni::local_ref AndroidUIScheduler::initHybrid(jni::alias_ref jThis) { +jni::local_ref AndroidUIScheduler::initHybrid( + jni::alias_ref jThis) { return makeCxxInstance(jThis); } @@ -37,7 +42,8 @@ void AndroidUIScheduler::triggerUI() { } void AndroidUIScheduler::scheduleTriggerOnUI() { - static const auto method = javaPart_->getClass()->getMethod("scheduleTriggerOnUI"); + static const auto method = + javaPart_->getClass()->getMethod("scheduleTriggerOnUI"); method(javaPart_.get()); } diff --git a/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/AndroidUIScheduler.h b/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/AndroidUIScheduler.h index e765edf2..a03afc93 100644 --- a/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/AndroidUIScheduler.h +++ b/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/AndroidUIScheduler.h @@ -14,8 +14,10 @@ using namespace worklets; class AndroidUIScheduler : public jni::HybridClass { public: - static auto constexpr kJavaDescriptor = "Lcom/swmansion/worklets/AndroidUIScheduler;"; - static jni::local_ref initHybrid(jni::alias_ref jThis); + static auto constexpr kJavaDescriptor = + "Lcom/swmansion/worklets/AndroidUIScheduler;"; + static jni::local_ref initHybrid( + jni::alias_ref jThis); static void registerNatives(); std::shared_ptr getUIScheduler() { @@ -34,7 +36,8 @@ class AndroidUIScheduler : public jni::HybridClass { jni::global_ref javaPart_; std::shared_ptr uiScheduler_; - explicit AndroidUIScheduler(jni::alias_ref jThis); + explicit AndroidUIScheduler( + jni::alias_ref jThis); }; } // namespace worklets diff --git a/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/AnimationFrameCallback.h b/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/AnimationFrameCallback.h index 655af6cf..2083ea12 100644 --- a/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/AnimationFrameCallback.h +++ b/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/AnimationFrameCallback.h @@ -6,9 +6,11 @@ namespace worklets { -class AnimationFrameCallback : public facebook::jni::HybridClass { +class AnimationFrameCallback + : public facebook::jni::HybridClass { public: - static auto constexpr kJavaDescriptor = "Lcom/swmansion/worklets/runloop/AnimationFrameCallback;"; + static auto constexpr kJavaDescriptor = + "Lcom/swmansion/worklets/runloop/AnimationFrameCallback;"; void onAnimationFrame(double timestampMs) { callback_(timestampMs); @@ -16,14 +18,16 @@ class AnimationFrameCallback : public facebook::jni::HybridClassregisterNatives({ - makeNativeMethod("onAnimationFrame", AnimationFrameCallback::onAnimationFrame), + makeNativeMethod( + "onAnimationFrame", AnimationFrameCallback::onAnimationFrame), }); } private: friend HybridBase; - explicit AnimationFrameCallback(std::function callback) : callback_(std::move(callback)) {} + explicit AnimationFrameCallback(std::function callback) + : callback_(std::move(callback)) {} std::function callback_; }; diff --git a/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/PlatformLogger.cpp b/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/PlatformLogger.cpp index c9b5dce9..e931aa90 100644 --- a/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/PlatformLogger.cpp +++ b/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/PlatformLogger.cpp @@ -2,8 +2,6 @@ #include -#include - constexpr const auto tag = "Worklets"; namespace worklets { diff --git a/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/WorkletsModule.cpp b/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/WorkletsModule.cpp index 2237cce4..84979ee6 100644 --- a/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/WorkletsModule.cpp +++ b/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/WorkletsModule.cpp @@ -5,7 +5,6 @@ #include #include -#include #include namespace worklets { @@ -19,7 +18,7 @@ WorkletsModule::WorkletsModule( jni::alias_ref messageQueueThread, const std::shared_ptr &jsCallInvoker, const std::shared_ptr &uiScheduler, - const std::shared_ptr &script, + const std::shared_ptr &script, const std::string &sourceURL) : javaPart_(jni::make_global(jThis)), rnRuntime_(rnRuntime), @@ -29,25 +28,32 @@ WorkletsModule::WorkletsModule( jsCallInvoker, uiScheduler, getIsOnJSQueueThread(), - RuntimeBindings{.requestAnimationFrame = getRequestAnimationFrame()}, + getForwardedRequestAnimationFrame(), script, sourceURL)) { - auto jsiWorkletsModuleProxy = workletsModuleProxy_->createJSIWorkletsModuleProxy(); + auto jsiWorkletsModuleProxy = + workletsModuleProxy_->createJSIWorkletsModuleProxy(); auto optimizedJsiWorkletsModuleProxy = jsi_utils::optimizedFromHostObject( - *rnRuntime_, std::static_pointer_cast(std::move(jsiWorkletsModuleProxy))); + *rnRuntime_, + std::static_pointer_cast( + std::move(jsiWorkletsModuleProxy))); RNRuntimeWorkletDecorator::decorate( - *rnRuntime_, std::move(optimizedJsiWorkletsModuleProxy), workletsModuleProxy_->getJSLogger()); + *rnRuntime_, + std::move(optimizedJsiWorkletsModuleProxy), + workletsModuleProxy_->getJSLogger()); } jni::local_ref WorkletsModule::initHybrid( jni::alias_ref jThis, jlong jsContext, jni::alias_ref messageQueueThread, - jni::alias_ref jsCallInvokerHolder, + jni::alias_ref + jsCallInvokerHolder, jni::alias_ref androidUIScheduler #ifdef WORKLETS_BUNDLE_MODE , - jni::alias_ref bundleWrapper, + jni::alias_ref + scriptWrapper, const std::string &sourceURL #endif // WORKLETS_BUNDLE_MODE ) { @@ -55,27 +61,42 @@ jni::local_ref WorkletsModule::initHybrid( auto rnRuntime = reinterpret_cast(jsContext); auto uiScheduler = androidUIScheduler->cthis()->getUIScheduler(); - std::shared_ptr script = nullptr; + std::shared_ptr script = nullptr; #ifdef WORKLETS_BUNDLE_MODE - script = bundleWrapper->cthis()->getBundle(); + script = scriptWrapper->cthis()->getScript(); #else const auto sourceURL = std::string{}; #endif // WORKLETS_BUNDLE_MODE - return makeCxxInstance(jThis, rnRuntime, messageQueueThread, jsCallInvoker, uiScheduler, script, sourceURL); + return makeCxxInstance( + jThis, + rnRuntime, + messageQueueThread, + jsCallInvoker, + uiScheduler, + script, + sourceURL); } -RuntimeBindings::RequestAnimationFrame WorkletsModule::getRequestAnimationFrame() { - return [javaPart = javaPart_](std::function &&callback) -> void { +std::function)> +WorkletsModule::getForwardedRequestAnimationFrame() { + return [javaPart = + javaPart_](std::function &&callback) -> void { static const auto jRequestAnimationFrame = - javaPart->getClass()->getMethod("requestAnimationFrame"); - jRequestAnimationFrame(javaPart.get(), AnimationFrameCallback::newObjectCxxArgs(std::move(callback)).get()); + javaPart->getClass() + ->getMethod( + "requestAnimationFrame"); + jRequestAnimationFrame( + javaPart.get(), + AnimationFrameCallback::newObjectCxxArgs(std::move(callback)).get()); }; } std::function WorkletsModule::getIsOnJSQueueThread() { return [javaPart = javaPart_]() -> bool { - return javaPart->getClass()->getMethod("isOnJSQueueThread").operator()(javaPart); + return javaPart->getClass() + ->getMethod("isOnJSQueueThread") + .operator()(javaPart); }; } diff --git a/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/WorkletsModule.h b/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/WorkletsModule.h index 292b4845..d63c98f7 100644 --- a/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/WorkletsModule.h +++ b/frontend-admin/node_modules/react-native-worklets/android/src/main/cpp/worklets/android/WorkletsModule.h @@ -3,14 +3,13 @@ #include #include #include +#include #include -#include #ifdef WORKLETS_BUNDLE_MODE -#include +#include #endif // WORKLETS_BUNDLE_MODE #include -#include #include #include @@ -23,17 +22,21 @@ using namespace facebook::jni; class WorkletsModule : public jni::HybridClass { public: - static auto constexpr kJavaDescriptor = "Lcom/swmansion/worklets/WorkletsModule;"; + static auto constexpr kJavaDescriptor = + "Lcom/swmansion/worklets/WorkletsModule;"; static jni::local_ref initHybrid( jni::alias_ref jThis, jlong jsContext, jni::alias_ref messageQueueThread, - jni::alias_ref jsCallInvokerHolder, - jni::alias_ref androidUIScheduler + jni::alias_ref + jsCallInvokerHolder, + jni::alias_ref + androidUIScheduler #ifdef WORKLETS_BUNDLE_MODE , - jni::alias_ref bundleWrapper, + jni::alias_ref + scriptWrapper, const std::string &sourceURL #endif // WORKLETS_BUNDLE_MODE ); @@ -51,7 +54,7 @@ class WorkletsModule : public jni::HybridClass { jni::alias_ref messageQueueThread, const std::shared_ptr &jsCallInvoker, const std::shared_ptr &uiScheduler, - const std::shared_ptr &bundle, + const std::shared_ptr &script, const std::string &sourceURL); void invalidateCpp(); @@ -61,7 +64,8 @@ class WorkletsModule : public jni::HybridClass { return javaPart_->getClass()->getMethod(methodName.c_str()); } - RuntimeBindings::RequestAnimationFrame getRequestAnimationFrame(); + std::function)> + getForwardedRequestAnimationFrame(); std::function getIsOnJSQueueThread(); diff --git a/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/AnimationFrameQueue.mm b/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/AnimationFrameQueue.mm index b93cd2c6..6d9f3232 100644 --- a/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/AnimationFrameQueue.mm +++ b/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/AnimationFrameQueue.mm @@ -5,10 +5,6 @@ #import #import -#if TARGET_OS_OSX -#import -#endif // TARGET_OS_OSX - #import constexpr auto TIME_SAMPLES_AMOUNT = 4; @@ -38,11 +34,7 @@ typedef void (^AnimationFrameCallback)(WorkletsDisplayLink *displayLink); { AssertJavaScriptQueue(); if constexpr (worklets::StaticFeatureFlags::getFlag("IOS_DYNAMIC_FRAMERATE_ENABLED")) { - bool supportsProMotion = false; -#if !TARGET_OS_OSX - supportsProMotion = [UIScreen mainScreen].maximumFramesPerSecond > 60; -#endif // !TARGET_OS_OSX - + bool supportsProMotion = [UIScreen mainScreen].maximumFramesPerSecond > 60; SEL frameCallback = supportsProMotion ? @selector(executeQueueForProMotion:) : @selector(executeQueue:); currentFrameRate_ = supportsProMotion ? FrameRateRange::BEST : FrameRateRange::STANDARD; displayLink_ = [WorkletsDisplayLink displayLinkWithTarget:self selector:frameCallback]; @@ -128,9 +120,7 @@ typedef void (^AnimationFrameCallback)(WorkletsDisplayLink *displayLink); frameRateRange = FrameRateRange::POOR; } if (currentFrameRate_.preferred != frameRateRange.preferred) { -#if !TARGET_OS_OSX displayLink_.preferredFrameRateRange = frameRateRange; -#endif // !TARGET_OS_OSX currentFrameRate_ = frameRateRange; } } diff --git a/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/AssertTurboModuleManagerQueue.h b/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/AssertTurboModuleManagerQueue.h index b5c99c35..fc15f7f8 100644 --- a/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/AssertTurboModuleManagerQueue.h +++ b/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/AssertTurboModuleManagerQueue.h @@ -1,12 +1,16 @@ #import -constexpr auto turboModuleManagerQueueLabel = "com.meta.react.turbomodulemanager.queue"; +constexpr auto turboModuleManagerQueueLabel = + "com.meta.react.turbomodulemanager.queue"; static bool IsTurboModuleManagerQueue() { - const auto currentQueueLabel = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL); + const auto currentQueueLabel = + dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL); return strcmp(currentQueueLabel, turboModuleManagerQueueLabel) == 0; } static void AssertTurboModuleManagerQueue() { - react_native_assert(IsTurboModuleManagerQueue() && "This function must be called on the TurboModuleManager queue"); + react_native_assert( + IsTurboModuleManagerQueue() && + "This function must be called on the TurboModuleManager queue"); } diff --git a/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/IOSUIScheduler.h b/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/IOSUIScheduler.h index 09b0ce20..19832055 100644 --- a/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/IOSUIScheduler.h +++ b/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/IOSUIScheduler.h @@ -6,7 +6,8 @@ using namespace facebook; using namespace react; using namespace worklets; -class IOSUIScheduler : public UIScheduler, public std::enable_shared_from_this { +class IOSUIScheduler : public UIScheduler, + public std::enable_shared_from_this { public: void scheduleOnUI(std::function job) override; }; diff --git a/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/WorkletsModule.mm b/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/WorkletsModule.mm index 66fa2454..69b49a85 100644 --- a/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/WorkletsModule.mm +++ b/frontend-admin/node_modules/react-native-worklets/apple/worklets/apple/WorkletsModule.mm @@ -1,5 +1,4 @@ #import -#import #import #import #import @@ -13,12 +12,8 @@ #import #import -#if __has_include() -// Bundle mode -#import -#endif // __has_include() - -using namespace worklets; +using worklets::RNRuntimeWorkletDecorator; +using worklets::WorkletsModuleProxy; @interface RCTBridge (JSIRuntime) - (void *)runtime; @@ -28,7 +23,7 @@ using namespace worklets; AnimationFrameQueue *animationFrameQueue_; std::shared_ptr workletsModuleProxy_; #ifndef NDEBUG - SingleInstanceChecker singleInstanceChecker_; + worklets::SingleInstanceChecker singleInstanceChecker_; #endif // NDEBUG } @@ -38,10 +33,11 @@ using namespace worklets; return workletsModuleProxy_; } -#if __has_include() +#if __has_include() // Bundle mode -@synthesize bundleProvider = bundleProvider_; -#endif // __has_include() +@synthesize scriptBuffer = scriptBuffer_; +@synthesize sourceURL = sourceURL_; +#endif // __has_include() - (void)checkBridgeless { @@ -49,7 +45,7 @@ using namespace worklets; react_native_assert(isBridgeless && "[Worklets] react-native-worklets only supports bridgeless mode"); } -@synthesize callInvoker = callInvoker_; +@synthesize callInvoker = _callInvoker; RCT_EXPORT_MODULE(WorkletsModule); @@ -63,28 +59,36 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(installTurboModule) jsi::Runtime &rnRuntime = *reinterpret_cast(self.bridge.runtime); - auto jsQueue = - std::make_shared([NSRunLoop currentRunLoop], ^(NSError *error) { throw error; }); + auto jsQueue = std::make_shared([NSRunLoop currentRunLoop], ^(NSError *error) { + throw error; + }); std::string sourceURL = ""; - std::shared_ptr script = nullptr; + std::shared_ptr script = nullptr; #ifdef WORKLETS_BUNDLE_MODE - script = [bundleProvider_ getBundle]; - sourceURL = [[bundleProvider_ getSourceURL] UTF8String]; + script = [scriptBuffer_ getBuffer]; + sourceURL = [sourceURL_ UTF8String]; #endif // WORKLETS_BUNDLE_MODE - auto jsCallInvoker = callInvoker_.callInvoker; - auto uiScheduler = std::make_shared(); - auto isJavaScriptQueue = []() -> bool { - return IsJavaScriptQueue(); - }; + auto jsCallInvoker = _callInvoker.callInvoker; + auto uiScheduler = std::make_shared(); + auto isJavaScriptQueue = []() -> bool { return IsJavaScriptQueue(); }; animationFrameQueue_ = [AnimationFrameQueue new]; - auto runtimeBindings = [self getRuntimeBindings]; - + auto forwardedRequestAnimationFrame = std::function)>( + [animationFrameQueue = animationFrameQueue_](std::function callback) { + [animationFrameQueue requestAnimationFrame:callback]; + }); workletsModuleProxy_ = std::make_shared( - rnRuntime, jsQueue, jsCallInvoker, uiScheduler, std::move(isJavaScriptQueue), runtimeBindings, script, sourceURL); + rnRuntime, + jsQueue, + jsCallInvoker, + uiScheduler, + std::move(isJavaScriptQueue), + std::move(forwardedRequestAnimationFrame), + script, + sourceURL); auto jsiWorkletsModuleProxy = workletsModuleProxy_->createJSIWorkletsModuleProxy(); - auto optimizedJsiWorkletsModuleProxy = jsi_utils::optimizedFromHostObject( + auto optimizedJsiWorkletsModuleProxy = worklets::jsi_utils::optimizedFromHostObject( rnRuntime, std::static_pointer_cast(std::move(jsiWorkletsModuleProxy))); RNRuntimeWorkletDecorator::decorate( rnRuntime, std::move(optimizedJsiWorkletsModuleProxy), workletsModuleProxy_->getJSLogger()); @@ -114,13 +118,4 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(installTurboModule) return std::make_shared(params); } -- (RuntimeBindings)getRuntimeBindings -{ - return { - .requestAnimationFrame = [animationFrameQueue = - animationFrameQueue_](std::function &&callback) -> void { - [animationFrameQueue requestAnimationFrame:callback]; - }}; -} - @end diff --git a/frontend-admin/node_modules/react-native-worklets/bundleMode/index.js b/frontend-admin/node_modules/react-native-worklets/bundleMode/index.js index 25512b58..22d5aa38 100644 --- a/frontend-admin/node_modules/react-native-worklets/bundleMode/index.js +++ b/frontend-admin/node_modules/react-native-worklets/bundleMode/index.js @@ -5,35 +5,15 @@ const workletsPackageParentDir = path.resolve(__dirname, '../..'); const defaults = getDefaultConfig(__dirname); -function getEntryPoints() { - const entryPoints = []; - try { - entryPoints.push( - require.resolve( - 'react-native-worklets/src/initializers/workletRuntimeEntry.native.ts' - ) - ); - } catch { - /* empty */ - } - try { - entryPoints.push( - require.resolve( - 'react-native-worklets/lib/module/initializers/workletRuntimeEntry.native.js' - ) - ); - } catch { - /* empty */ - } - return entryPoints; -} - module.exports = { bundleModeMetroConfig: { serializer: { getModulesRunBeforeMainModule(/** @type {string} dirname */ dirname) { return [ - ...getEntryPoints(), + require.resolve('react-native-worklets/src/workletRuntimeEntry.ts'), + require.resolve( + 'react-native-worklets/lib/module/workletRuntimeEntry.js' + ), ...defaults.serializer.getModulesRunBeforeMainModule(dirname), ]; }, diff --git a/frontend-admin/node_modules/react-native-worklets/compatibility.json b/frontend-admin/node_modules/react-native-worklets/compatibility.json index 965bb91d..523807fc 100644 --- a/frontend-admin/node_modules/react-native-worklets/compatibility.json +++ b/frontend-admin/node_modules/react-native-worklets/compatibility.json @@ -1,12 +1,6 @@ { "nightly": { - "react-native": ["0.79", "0.80", "0.81", "0.82"] - }, - "0.7.x": { - "react-native": ["0.79", "0.80", "0.81", "0.82", "0.83"] - }, - "0.6.x": { - "react-native": ["0.78", "0.79", "0.80", "0.81", "0.82"] + "react-native": ["0.78", "0.79", "0.80", "0.81"] }, "0.5.x": { "react-native": ["0.78", "0.79", "0.80", "0.81"] diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/WorkletsModule/NativeWorklets.js b/frontend-admin/node_modules/react-native-worklets/lib/module/WorkletsModule/NativeWorklets.js index 3569cad0..7581ae27 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/WorkletsModule/NativeWorklets.js +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/WorkletsModule/NativeWorklets.js @@ -1,4 +1,126 @@ 'use strict'; -export const WorkletsModule = null; +import { RuntimeKind } from "../runtimeKind.js"; +import { WorkletsTurboModule } from "../specs/index.js"; +import { checkCppVersion } from "../utils/checkCppVersion.js"; +import { jsVersion } from "../utils/jsVersion.js"; +import { WorkletsError } from "../WorkletsError.js"; +export function createNativeWorkletsModule() { + return new NativeWorklets(); +} +class NativeWorklets { + #workletsModuleProxy; + #serializableUndefined; + #serializableNull; + #serializableTrue; + #serializableFalse; + constructor() { + globalThis._WORKLETS_VERSION_JS = jsVersion; + if (global.__workletsModuleProxy === undefined && globalThis.__RUNTIME_KIND === RuntimeKind.ReactNative) { + WorkletsTurboModule?.installTurboModule(); + } + if (global.__workletsModuleProxy === undefined) { + throw new WorkletsError(`Native part of Worklets doesn't seem to be initialized. +See https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#native-part-of-worklets-doesnt-seem-to-be-initialized for more details.`); + } + if (__DEV__) { + checkCppVersion(); + } + this.#workletsModuleProxy = global.__workletsModuleProxy; + this.#serializableNull = this.#workletsModuleProxy.createSerializableNull(); + this.#serializableUndefined = this.#workletsModuleProxy.createSerializableUndefined(); + this.#serializableTrue = this.#workletsModuleProxy.createSerializableBoolean(true); + this.#serializableFalse = this.#workletsModuleProxy.createSerializableBoolean(false); + } + createSerializable(value, shouldPersistRemote, nativeStateSource) { + return this.#workletsModuleProxy.createSerializable(value, shouldPersistRemote, nativeStateSource); + } + createSerializableImport(from, to) { + return this.#workletsModuleProxy.createSerializableImport(from, to); + } + createSerializableString(str) { + return this.#workletsModuleProxy.createSerializableString(str); + } + createSerializableNumber(num) { + return this.#workletsModuleProxy.createSerializableNumber(num); + } + createSerializableBoolean(bool) { + return bool ? this.#serializableTrue : this.#serializableFalse; + } + createSerializableBigInt(bigInt) { + return this.#workletsModuleProxy.createSerializableBigInt(bigInt); + } + createSerializableUndefined() { + return this.#serializableUndefined; + } + createSerializableNull() { + return this.#serializableNull; + } + createSerializableTurboModuleLike(props, proto) { + return this.#workletsModuleProxy.createSerializableTurboModuleLike(props, proto); + } + createSerializableObject(obj, shouldRetainRemote, nativeStateSource) { + return this.#workletsModuleProxy.createSerializableObject(obj, shouldRetainRemote, nativeStateSource); + } + createSerializableHostObject(obj) { + return this.#workletsModuleProxy.createSerializableHostObject(obj); + } + createSerializableArray(array, shouldRetainRemote) { + return this.#workletsModuleProxy.createSerializableArray(array, shouldRetainRemote); + } + createSerializableMap(keys, values) { + return this.#workletsModuleProxy.createSerializableMap(keys, values); + } + createSerializableSet(values) { + return this.#workletsModuleProxy.createSerializableSet(values); + } + createSerializableInitializer(obj) { + return this.#workletsModuleProxy.createSerializableInitializer(obj); + } + createSerializableFunction(func) { + return this.#workletsModuleProxy.createSerializableFunction(func); + } + createSerializableWorklet(worklet, shouldPersistRemote) { + return this.#workletsModuleProxy.createSerializableWorklet(worklet, shouldPersistRemote); + } + scheduleOnUI(serializable) { + return this.#workletsModuleProxy.scheduleOnUI(serializable); + } + executeOnUIRuntimeSync(serializable) { + return this.#workletsModuleProxy.executeOnUIRuntimeSync(serializable); + } + createWorkletRuntime(name, initializer, useDefaultQueue, customQueue, enableEventLoop) { + return this.#workletsModuleProxy.createWorkletRuntime(name, initializer, useDefaultQueue, customQueue, enableEventLoop); + } + scheduleOnRuntime(workletRuntime, serializableWorklet) { + return this.#workletsModuleProxy.scheduleOnRuntime(workletRuntime, serializableWorklet); + } + createSynchronizable(value) { + return this.#workletsModuleProxy.createSynchronizable(value); + } + synchronizableGetDirty(synchronizableRef) { + return this.#workletsModuleProxy.synchronizableGetDirty(synchronizableRef); + } + synchronizableGetBlocking(synchronizableRef) { + return this.#workletsModuleProxy.synchronizableGetBlocking(synchronizableRef); + } + synchronizableSetBlocking(synchronizableRef, value) { + return this.#workletsModuleProxy.synchronizableSetBlocking(synchronizableRef, value); + } + synchronizableLock(synchronizableRef) { + return this.#workletsModuleProxy.synchronizableLock(synchronizableRef); + } + synchronizableUnlock(synchronizableRef) { + return this.#workletsModuleProxy.synchronizableUnlock(synchronizableRef); + } + reportFatalErrorOnJS(message, stack, name, jsEngine) { + return this.#workletsModuleProxy.reportFatalErrorOnJS(message, stack, name, jsEngine); + } + getStaticFeatureFlag(name) { + return this.#workletsModuleProxy.getStaticFeatureFlag(name); + } + setDynamicFeatureFlag(name, value) { + this.#workletsModuleProxy.setDynamicFeatureFlag(name, value); + } +} //# sourceMappingURL=NativeWorklets.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/WorkletsModule/NativeWorklets.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/WorkletsModule/NativeWorklets.js.map index a8378e6b..4f064991 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/WorkletsModule/NativeWorklets.js.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/WorkletsModule/NativeWorklets.js.map @@ -1 +1 @@ -{"version":3,"names":["WorkletsModule"],"sourceRoot":"../../../src","sources":["WorkletsModule/NativeWorklets.ts"],"mappings":"AAAA,YAAY;;AASZ,OAAO,MAAMA,cAA+B,GAAG,IAAK","ignoreList":[]} +{"version":3,"names":["RuntimeKind","WorkletsTurboModule","checkCppVersion","jsVersion","WorkletsError","createNativeWorkletsModule","NativeWorklets","workletsModuleProxy","serializableUndefined","serializableNull","serializableTrue","serializableFalse","constructor","globalThis","_WORKLETS_VERSION_JS","global","__workletsModuleProxy","undefined","__RUNTIME_KIND","ReactNative","installTurboModule","__DEV__","createSerializableNull","createSerializableUndefined","createSerializableBoolean","createSerializable","value","shouldPersistRemote","nativeStateSource","createSerializableImport","from","to","createSerializableString","str","createSerializableNumber","num","bool","createSerializableBigInt","bigInt","createSerializableTurboModuleLike","props","proto","createSerializableObject","obj","shouldRetainRemote","createSerializableHostObject","createSerializableArray","array","createSerializableMap","keys","values","createSerializableSet","createSerializableInitializer","createSerializableFunction","func","createSerializableWorklet","worklet","scheduleOnUI","serializable","executeOnUIRuntimeSync","createWorkletRuntime","name","initializer","useDefaultQueue","customQueue","enableEventLoop","scheduleOnRuntime","workletRuntime","serializableWorklet","createSynchronizable","synchronizableGetDirty","synchronizableRef","synchronizableGetBlocking","synchronizableSetBlocking","synchronizableLock","synchronizableUnlock","reportFatalErrorOnJS","message","stack","jsEngine","getStaticFeatureFlag","setDynamicFeatureFlag"],"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AACqE,oBAAoB,CACnDC,OAAO,EACPC,KAAK,EACLjB,IAAI,EACJkB,QACF,CAAC;EACH;EAEAC,oBAAoBA,CAACnB,IAAY,EAAW;IAC1C,OAAO,IAAI,CAAC,CAACtD,mBAAmB,CAACyE,oBAAoB,CAACnB,IAAI,CAAC;EAC7D;EAEAoB,qBAAqBA,CAACpB,IAAY,EAAEnC,KAAc,EAAE;IAClD,IAAI,CAAC,CAACnB,mBAAmB,CAAC0E,qBAAqB,CAACpB,IAAI,EAAEnC,KAAK,CAAC;EAC9D;AACF","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/WorkletsModule/NativeWorklets.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/WorkletsModule/NativeWorklets.native.js deleted file mode 100644 index f0bd231c..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/WorkletsModule/NativeWorklets.native.js +++ /dev/null @@ -1,130 +0,0 @@ -'use strict'; - -import { checkCppVersion } from '../debug/checkCppVersion'; -import { jsVersion } from '../debug/jsVersion'; -import { WorkletsError } from '../debug/WorkletsError'; -import { RuntimeKind } from '../runtimeKind'; -import { WorkletsTurboModule } from '../specs'; -class NativeWorklets { - #workletsModuleProxy; - #serializableUndefined; - #serializableNull; - #serializableTrue; - #serializableFalse; - constructor() { - globalThis._WORKLETS_VERSION_JS = jsVersion; - if (global.__workletsModuleProxy === undefined && globalThis.__RUNTIME_KIND === RuntimeKind.ReactNative) { - WorkletsTurboModule?.installTurboModule(); - } - if (global.__workletsModuleProxy === undefined) { - throw new WorkletsError(`Native part of Worklets doesn't seem to be initialized. -See https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#native-part-of-worklets-doesnt-seem-to-be-initialized for more details.`); - } - if (__DEV__ && globalThis.__RUNTIME_KIND === RuntimeKind.ReactNative) { - checkCppVersion(); - } - this.#workletsModuleProxy = global.__workletsModuleProxy; - this.#serializableNull = this.#workletsModuleProxy.createSerializableNull(); - this.#serializableUndefined = this.#workletsModuleProxy.createSerializableUndefined(); - this.#serializableTrue = this.#workletsModuleProxy.createSerializableBoolean(true); - this.#serializableFalse = this.#workletsModuleProxy.createSerializableBoolean(false); - } - createSerializable(value, shouldPersistRemote, nativeStateSource) { - return this.#workletsModuleProxy.createSerializable(value, shouldPersistRemote, nativeStateSource); - } - createSerializableImport(from, to) { - return this.#workletsModuleProxy.createSerializableImport(from, to); - } - createSerializableString(str) { - return this.#workletsModuleProxy.createSerializableString(str); - } - createSerializableNumber(num) { - return this.#workletsModuleProxy.createSerializableNumber(num); - } - createSerializableBoolean(bool) { - return bool ? this.#serializableTrue : this.#serializableFalse; - } - createSerializableBigInt(bigInt) { - return this.#workletsModuleProxy.createSerializableBigInt(bigInt); - } - createSerializableUndefined() { - return this.#serializableUndefined; - } - createSerializableNull() { - return this.#serializableNull; - } - createSerializableTurboModuleLike(props, proto) { - return this.#workletsModuleProxy.createSerializableTurboModuleLike(props, proto); - } - createSerializableObject(obj, shouldRetainRemote, nativeStateSource) { - return this.#workletsModuleProxy.createSerializableObject(obj, shouldRetainRemote, nativeStateSource); - } - createSerializableHostObject(obj) { - return this.#workletsModuleProxy.createSerializableHostObject(obj); - } - createSerializableArray(array, shouldRetainRemote) { - return this.#workletsModuleProxy.createSerializableArray(array, shouldRetainRemote); - } - createSerializableMap(keys, values) { - return this.#workletsModuleProxy.createSerializableMap(keys, values); - } - createSerializableSet(values) { - return this.#workletsModuleProxy.createSerializableSet(values); - } - createSerializableInitializer(obj) { - return this.#workletsModuleProxy.createSerializableInitializer(obj); - } - createSerializableFunction(func) { - return this.#workletsModuleProxy.createSerializableFunction(func); - } - createSerializableWorklet(worklet, shouldPersistRemote) { - return this.#workletsModuleProxy.createSerializableWorklet(worklet, shouldPersistRemote); - } - createCustomSerializable(data, typeId) { - return this.#workletsModuleProxy.createCustomSerializable(data, typeId); - } - registerCustomSerializable(determine, pack, unpack, typeId) { - this.#workletsModuleProxy.registerCustomSerializable(determine, pack, unpack, typeId); - } - scheduleOnUI(serializable) { - return this.#workletsModuleProxy.scheduleOnUI(serializable); - } - executeOnUIRuntimeSync(serializable) { - return this.#workletsModuleProxy.executeOnUIRuntimeSync(serializable); - } - createWorkletRuntime(name, initializer, useDefaultQueue, customQueue, enableEventLoop) { - return this.#workletsModuleProxy.createWorkletRuntime(name, initializer, useDefaultQueue, customQueue, enableEventLoop); - } - scheduleOnRuntime(workletRuntime, serializableWorklet) { - return this.#workletsModuleProxy.scheduleOnRuntime(workletRuntime, serializableWorklet); - } - createSynchronizable(value) { - return this.#workletsModuleProxy.createSynchronizable(value); - } - synchronizableGetDirty(synchronizableRef) { - return this.#workletsModuleProxy.synchronizableGetDirty(synchronizableRef); - } - synchronizableGetBlocking(synchronizableRef) { - return this.#workletsModuleProxy.synchronizableGetBlocking(synchronizableRef); - } - synchronizableSetBlocking(synchronizableRef, value) { - return this.#workletsModuleProxy.synchronizableSetBlocking(synchronizableRef, value); - } - synchronizableLock(synchronizableRef) { - return this.#workletsModuleProxy.synchronizableLock(synchronizableRef); - } - synchronizableUnlock(synchronizableRef) { - return this.#workletsModuleProxy.synchronizableUnlock(synchronizableRef); - } - reportFatalErrorOnJS(message, stack, name, jsEngine) { - return this.#workletsModuleProxy.reportFatalErrorOnJS(message, stack, name, jsEngine); - } - getStaticFeatureFlag(name) { - return this.#workletsModuleProxy.getStaticFeatureFlag(name); - } - setDynamicFeatureFlag(name, value) { - this.#workletsModuleProxy.setDynamicFeatureFlag(name, value); - } -} -export const WorkletsModule = new NativeWorklets(); -//# sourceMappingURL=NativeWorklets.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/WorkletsModule/NativeWorklets.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/WorkletsModule/NativeWorklets.native.js.map deleted file mode 100644 index 38b2d13a..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/WorkletsModule/NativeWorklets.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["checkCppVersion","jsVersion","WorkletsError","RuntimeKind","WorkletsTurboModule","NativeWorklets","workletsModuleProxy","serializableUndefined","serializableNull","serializableTrue","serializableFalse","constructor","globalThis","_WORKLETS_VERSION_JS","global","__workletsModuleProxy","undefined","__RUNTIME_KIND","ReactNative","installTurboModule","__DEV__","createSerializableNull","createSerializableUndefined","createSerializableBoolean","createSerializable","value","shouldPersistRemote","nativeStateSource","createSerializableImport","from","to","createSerializableString","str","createSerializableNumber","num","bool","createSerializableBigInt","bigInt","createSerializableTurboModuleLike","props","proto","createSerializableObject","obj","shouldRetainRemote","createSerializableHostObject","createSerializableArray","array","createSerializableMap","keys","values","createSerializableSet","createSerializableInitializer","createSerializableFunction","func","createSerializableWorklet","worklet","createCustomSerializable","data","typeId","registerCustomSerializable","determine","pack","unpack","scheduleOnUI","serializable","executeOnUIRuntimeSync","createWorkletRuntime","name","initializer","useDefaultQueue","customQueue","enableEventLoop","scheduleOnRuntime","workletRuntime","serializableWorklet","createSynchronizable","synchronizableGetDirty","synchronizableRef","synchronizableGetBlocking","synchronizableSetBlocking","synchronizableLock","synchronizableUnlock","reportFatalErrorOnJS","message","stack","jsEngine","getStaticFeatureFlag","setDynamicFeatureFlag","WorkletsModule"],"sourceRoot":"../../../src","sources":["WorkletsModule/NativeWorklets.native.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,eAAe,QAAQ,0BAA0B;AAC1D,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,aAAa,QAAQ,wBAAwB;AAEtD,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,mBAAmB,QAAQ,UAAU;AAO9C,MAAMC,cAAc,CAA4B;EAC9C,CAACC,mBAAmB;EACpB,CAACC,qBAAqB;EACtB,CAACC,gBAAgB;EACjB,CAACC,gBAAgB;EACjB,CAACC,iBAAiB;EAElBC,WAAWA,CAAA,EAAG;IACZC,UAAU,CAACC,oBAAoB,GAAGZ,SAAS;IAC3C,IACEa,MAAM,CAACC,qBAAqB,KAAKC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AAC;EAC7D;EAEAoB,qBAAqBA,CAACpB,IAAY,EAAE1C,KAAc,EAAE;IAClD,IAAI,CAAC,CAACnB,mBAAmB,CAACiF,qBAAqB,CAACpB,IAAI,EAAE1C,KAAK,CAAC;EAC9D;AACF;AAEA,OAAO,MAAM+D,cAA+B,GAAG,IAAInF,cAAc,CAAC,CAAC","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/callGuard.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/callGuard.native.js deleted file mode 100644 index 2cc1234b..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/callGuard.native.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -/** Used only with debug builds. */ -export function callGuardDEV(fn, ...args) { - 'worklet'; - - try { - return fn(...args); - } catch (error) { - if (globalThis.__workletsModuleProxy) { - const { - message, - stack, - name, - jsEngine - } = error; - globalThis.__workletsModuleProxy.reportFatalErrorOnJS(message, stack ?? '', name ?? 'WorkletsError', jsEngine ?? 'Worklets'); - } else { - throw error; - } - } -} -export function setupCallGuard() { - 'worklet'; - - if (!globalThis.__callGuardDEV) { - globalThis.__callGuardDEV = callGuardDEV; - } -} -//# sourceMappingURL=callGuard.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/callGuard.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/callGuard.native.js.map deleted file mode 100644 index 7548bd2a..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/callGuard.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["callGuardDEV","fn","args","error","globalThis","__workletsModuleProxy","message","stack","name","jsEngine","reportFatalErrorOnJS","setupCallGuard","__callGuardDEV"],"sourceRoot":"../../src","sources":["callGuard.native.ts"],"mappings":"AAAA,YAAY;;AAIZ;AACA,OAAO,SAASA,YAAYA,CAC1BC,EAAkC,EAClC,GAAGC,IAAU,EACO;EACpB,SAAS;;EACT,IAAI;IACF,OAAOD,EAAE,CAAC,GAAGC,IAAI,CAAC;EACpB,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,IAAIC,UAAU,CAACC,qBAAqB,EAAE;MACpC,MAAM;QAAEC,OAAO;QAAEC,KAAK;QAAEC,IAAI;QAAEC;MAAS,CAAC,GAAGN,KAAgB;MAC3DC,UAAU,CAACC,qBAAqB,CAACK,oBAAoB,CACnDJ,OAAO,EACPC,KAAK,IAAI,EAAE,EACXC,IAAI,IAAI,eAAe,EACvBC,QAAQ,IAAI,UACd,CAAC;IACH,CAAC,MAAM;MACL,MAAMN,KAAK;IACb;EACF;AACF;AAEA,OAAO,SAASQ,cAAcA,CAAA,EAAG;EAC/B,SAAS;;EACT,IAAI,CAACP,UAAU,CAACQ,cAAc,EAAE;IAC9BR,UAAU,CAACQ,cAAc,GAAGZ,YAAY;EAC1C;AACF","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/WorkletsError.js b/frontend-admin/node_modules/react-native-worklets/lib/module/debug/WorkletsError.js deleted file mode 100644 index def6933c..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/WorkletsError.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -function WorkletsErrorConstructor(message) { - const prefix = '[Worklets]'; - - // eslint-disable-next-line reanimated/use-worklets-error - const errorInstance = new Error(message ? `${prefix} ${message}` : prefix); - errorInstance.name = `WorkletsError`; - return errorInstance; -} -export const WorkletsError = WorkletsErrorConstructor; -//# sourceMappingURL=WorkletsError.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/WorkletsError.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/debug/WorkletsError.js.map deleted file mode 100644 index d9f9169c..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/WorkletsError.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["WorkletsErrorConstructor","message","prefix","errorInstance","Error","name","WorkletsError"],"sourceRoot":"../../../src","sources":["debug/WorkletsError.ts"],"mappings":"AAAA,YAAY;;AAOZ,SAASA,wBAAwBA,CAACC,OAAgB,EAAkB;EAClE,MAAMC,MAAM,GAAG,YAAY;;EAE3B;EACA,MAAMC,aAAa,GAAG,IAAIC,KAAK,CAACH,OAAO,GAAG,GAAGC,MAAM,IAAID,OAAO,EAAE,GAAGC,MAAM,CAAC;EAC1EC,aAAa,CAACE,IAAI,GAAG,eAAe;EACpC,OAAOF,aAAa;AACtB;AAEA,OAAO,MAAMG,aAAa,GACxBN,wBAAqD","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/WorkletsError.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/debug/WorkletsError.native.js deleted file mode 100644 index d62ba78d..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/WorkletsError.native.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -import { RuntimeKind } from '../runtimeKind'; -function WorkletsErrorConstructor(message) { - 'worklet'; - - const prefix = '[Worklets]'; - - // eslint-disable-next-line reanimated/use-worklets-error - const errorInstance = new Error(message ? `${prefix} ${message}` : prefix); - errorInstance.name = `WorkletsError`; - return errorInstance; -} - -/** - * Registers WorkletsError in the global scope. Register only for Worklet - * runtimes. - */ -export function registerWorkletsError() { - 'worklet'; - - if (globalThis.__RUNTIME_KIND !== RuntimeKind.ReactNative) { - globalThis.WorkletsError = WorkletsErrorConstructor; - } -} -export const WorkletsError = WorkletsErrorConstructor; -//# sourceMappingURL=WorkletsError.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/WorkletsError.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/debug/WorkletsError.native.js.map deleted file mode 100644 index 5a14742e..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/WorkletsError.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["RuntimeKind","WorkletsErrorConstructor","message","prefix","errorInstance","Error","name","registerWorkletsError","globalThis","__RUNTIME_KIND","ReactNative","WorkletsError"],"sourceRoot":"../../../src","sources":["debug/WorkletsError.native.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,WAAW,QAAQ,gBAAgB;AAM5C,SAASC,wBAAwBA,CAACC,OAAgB,EAAkB;EAClE,SAAS;;EACT,MAAMC,MAAM,GAAG,YAAY;;EAE3B;EACA,MAAMC,aAAa,GAAG,IAAIC,KAAK,CAACH,OAAO,GAAG,GAAGC,MAAM,IAAID,OAAO,EAAE,GAAGC,MAAM,CAAC;EAC1EC,aAAa,CAACE,IAAI,GAAG,eAAe;EACpC,OAAOF,aAAa;AACtB;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASG,qBAAqBA,CAAA,EAAG;EACtC,SAAS;;EACT,IAAKC,UAAU,CAACC,cAAc,KAAqBT,WAAW,CAACU,WAAW,EAAE;IACzEF,UAAU,CAA6BG,aAAa,GACnDV,wBAAwB;EAC5B;AACF;AAEA,OAAO,MAAMU,aAAa,GACxBV,wBAAqD","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/checkCppVersion.js b/frontend-admin/node_modules/react-native-worklets/lib/module/debug/checkCppVersion.js deleted file mode 100644 index ae170b9c..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/checkCppVersion.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -import { jsVersion } from './jsVersion'; -import { logger } from './logger'; -import { WorkletsError } from './WorkletsError'; -export function checkCppVersion() { - const cppVersion = global._WORKLETS_VERSION_CPP; - if (cppVersion === undefined) { - logger.warn(`Couldn't determine the version of the native part of Worklets. - See \`https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#couldnt-determine-the-version-of-the-native-part-of-worklets\` for more details.`); - return; - } - const ok = matchVersion(jsVersion, cppVersion); - if (!ok) { - throw new WorkletsError(`Mismatch between JavaScript part and native part of Worklets (${jsVersion} vs ${cppVersion}). - See \`https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#mismatch-between-javascript-part-and-native-part-of-worklets\` for more details.`); - } -} -export function matchVersion(version1, version2) { - if (version1.match(/^\d+\.\d+\.\d+$/) && version2.match(/^\d+\.\d+\.\d+$/)) { - // x.y.z, compare only major and minor, skip patch - const [major1, minor1] = version1.split('.'); - const [major2, minor2] = version2.split('.'); - return major1 === major2 && minor1 === minor2; - } else { - // alpha, beta or rc, compare everything - return version1 === version2; - } -} -//# sourceMappingURL=checkCppVersion.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/checkCppVersion.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/debug/checkCppVersion.js.map deleted file mode 100644 index 217010df..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/checkCppVersion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["jsVersion","logger","WorkletsError","checkCppVersion","cppVersion","global","_WORKLETS_VERSION_CPP","undefined","warn","ok","matchVersion","version1","version2","match","major1","minor1","split","major2","minor2"],"sourceRoot":"../../../src","sources":["debug/checkCppVersion.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,SAAS,QAAQ,aAAa;AACvC,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,aAAa,QAAQ,iBAAiB;AAE/C,OAAO,SAASC,eAAeA,CAAA,EAAG;EAChC,MAAMC,UAAU,GAAGC,MAAM,CAACC,qBAAqB;EAC/C,IAAIF,UAAU,KAAKG,SAAS,EAAE;IAC5BN,MAAM,CAACO,IAAI,CACT;AACN,wKACI,CAAC;IACD;EACF;EACA,MAAMC,EAAE,GAAGC,YAAY,CAACV,SAAS,EAAEI,UAAU,CAAC;EAC9C,IAAI,CAACK,EAAE,EAAE;IACP,MAAM,IAAIP,aAAa,CACrB,iEAAiEF,SAAS,OAAOI,UAAU;AACjG,wKACI,CAAC;EACH;AACF;AAEA,OAAO,SAASM,YAAYA,CAACC,QAAgB,EAAEC,QAAgB,EAAE;EAC/D,IAAID,QAAQ,CAACE,KAAK,CAAC,iBAAiB,CAAC,IAAID,QAAQ,CAACC,KAAK,CAAC,iBAAiB,CAAC,EAAE;IAC1E;IACA,MAAM,CAACC,MAAM,EAAEC,MAAM,CAAC,GAAGJ,QAAQ,CAACK,KAAK,CAAC,GAAG,CAAC;IAC5C,MAAM,CAACC,MAAM,EAAEC,MAAM,CAAC,GAAGN,QAAQ,CAACI,KAAK,CAAC,GAAG,CAAC;IAC5C,OAAOF,MAAM,KAAKG,MAAM,IAAIF,MAAM,KAAKG,MAAM;EAC/C,CAAC,MAAM;IACL;IACA,OAAOP,QAAQ,KAAKC,QAAQ;EAC9B;AACF","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/errors.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/debug/errors.native.js deleted file mode 100644 index d6f7688d..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/errors.native.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; - -import { WorkletsError } from './WorkletsError'; -const _workletStackDetails = new Map(); -export function registerWorkletStackDetails(hash, stackDetails) { - _workletStackDetails.set(hash, stackDetails); -} -function getBundleOffset(error) { - const frame = error.stack?.split('\n')?.[0]; - if (frame) { - const parsedFrame = /@([^@]+):(\d+):(\d+)/.exec(frame); - if (parsedFrame) { - const [, file, line, col] = parsedFrame; - return [file, Number(line), Number(col)]; - } - } - return ['unknown', 0, 0]; -} -function processStack(stack) { - if (stack === '' || stack === undefined) { - return undefined; - } - const workletStackEntries = stack.match(/worklet_(\d+):(\d+):(\d+)/g); - let result = stack; - workletStackEntries?.forEach(match => { - const [, hash, origLine, origCol] = match.split(/:|_/).map(Number); - const errorDetails = _workletStackDetails.get(hash); - if (!errorDetails) { - return; - } - const [error, lineOffset, colOffset] = errorDetails; - const [bundleFile, bundleLine, bundleCol] = getBundleOffset(error); - const line = origLine + bundleLine + lineOffset; - const col = origCol + bundleCol + colOffset; - result = result.replace(match, `${bundleFile}:${line}:${col}`); - }); - return result; -} -/** - * Remote error is an error coming from a Worklet Runtime that we bubble up to - * the RN Runtime. - */ -export function reportFatalRemoteError({ - message, - stack, - name, - jsEngine -}, force) { - const error = new WorkletsError(); - error.message = message; - error.stack = processStack(stack); - error.name = name; - error.jsEngine = jsEngine; - if (force) { - throw error; - } else { - // @ts-expect-error React Native's `ErrorUtils` are hidden from the global scope. - globalThis.ErrorUtils.reportFatalError(error); - } -} - -/** - * Registers `reportFatalRemoteError` function in global scope to allow to - * invoke it from C++. - */ -export function registerReportFatalRemoteError() { - globalThis.__reportFatalRemoteError = reportFatalRemoteError; -} -//# sourceMappingURL=errors.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/errors.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/debug/errors.native.js.map deleted file mode 100644 index 77ab5397..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/errors.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["WorkletsError","_workletStackDetails","Map","registerWorkletStackDetails","hash","stackDetails","set","getBundleOffset","error","frame","stack","split","parsedFrame","exec","file","line","col","Number","processStack","undefined","workletStackEntries","match","result","forEach","origLine","origCol","map","errorDetails","get","lineOffset","colOffset","bundleFile","bundleLine","bundleCol","replace","reportFatalRemoteError","message","name","jsEngine","force","globalThis","ErrorUtils","reportFatalError","registerReportFatalRemoteError","__reportFatalRemoteError"],"sourceRoot":"../../../src","sources":["debug/errors.native.ts"],"mappings":"AAAA,YAAY;;AAGZ,SAASA,aAAa,QAAQ,iBAAiB;AAE/C,MAAMC,oBAAoB,GAAG,IAAIC,GAAG,CAA8B,CAAC;AAEnE,OAAO,SAASC,2BAA2BA,CACzCC,IAAY,EACZC,YAAiC,EACjC;EACAJ,oBAAoB,CAACK,GAAG,CAACF,IAAI,EAAEC,YAAY,CAAC;AAC9C;AAEA,SAASE,eAAeA,CAACC,KAAY,EAA4B;EAC/D,MAAMC,KAAK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;IAE3CR,MAAM,GAAGA,MAAM,CAACY,OAAO,CAACb,KAAK,EAAE,GAAGU,UAAU,IAAIhB,IAAI,IAAIC,GAAG,EAAE,CAAC;EAChE,CAAC,CAAC;EACF,OAAOM,MAAM;AACf;AAMA;AACA;AACA;AACA;AACA,OAAO,SAASa,sBAAsBA,CACpC;EAAEC,OAAO;EAAE1B,KAAK;EAAE2B,IAAI;EAAEC;AAAkB,CAAC,EAC3CC,KAAc,EACR;EACN,MAAM/B,KAAK,GAAG,IAAIR,aAAa,CAAC,CAAY;EAC5CQ,KAAK,CAAC4B,OAAO,GAAGA,OAAO;EACvB5B,KAAK,CAACE,KAAK,GAAGQ,YAAY,CAACR,KAAK,CAAC;EACjCF,KAAK,CAAC6B,IAAI,GAAGA,IAAI;EACjB7B,KAAK,CAAC8B,QAAQ,GAAGA,QAAQ;EACzB,IAAIC,KAAK,EAAE;IACT,MAAM/B,KAAK;EACb,CAAC,MAAM;IACL;IACAgC,UAAU,CAACC,UAAU,CAACC,gBAAgB,CAAClC,KAAK,CAAC;EAC/C;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASmC,8BAA8BA,CAAA,EAAG;EAC/CH,UAAU,CAACI,wBAAwB,GAAGT,sBAAsB;AAC9D","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/jsVersion.js b/frontend-admin/node_modules/react-native-worklets/lib/module/debug/jsVersion.js deleted file mode 100644 index 33cb12ec..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/jsVersion.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -/** - * We hardcode the version of Worklets here in order to compare it with the - * version used to build the native part of the library in runtime. Remember to - * keep this in sync with the version declared in `package.json` - */ -export const jsVersion = '0.7.2'; -//# sourceMappingURL=jsVersion.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/jsVersion.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/debug/jsVersion.js.map deleted file mode 100644 index 43439678..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/jsVersion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["jsVersion"],"sourceRoot":"../../../src","sources":["debug/jsVersion.ts"],"mappings":"AAAA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,SAAS,GAAG,OAAO","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/logger.js b/frontend-admin/node_modules/react-native-worklets/lib/module/debug/logger.js deleted file mode 100644 index 4c412c35..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/logger.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -const PREFIX = '[Worklets]'; -function formatMessage(message) { - return `${PREFIX} ${message}`; -} -export const logger = { - warn(message) { - console.warn(formatMessage(message)); - }, - error(message) { - console.error(formatMessage(message)); - } -}; -//# sourceMappingURL=logger.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/logger.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/debug/logger.js.map deleted file mode 100644 index 89b7dc3b..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/logger.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["PREFIX","formatMessage","message","logger","warn","console","error"],"sourceRoot":"../../../src","sources":["debug/logger.ts"],"mappings":"AAAA,YAAY;;AAEZ,MAAMA,MAAM,GAAG,YAAY;AAE3B,SAASC,aAAaA,CAACC,OAAe,EAAE;EACtC,OAAO,GAAGF,MAAM,IAAIE,OAAO,EAAE;AAC/B;AAEA,OAAO,MAAMC,MAAM,GAAG;EACpBC,IAAIA,CAACF,OAAe,EAAE;IACpBG,OAAO,CAACD,IAAI,CAACH,aAAa,CAACC,OAAO,CAAC,CAAC;EACtC,CAAC;EACDI,KAAKA,CAACJ,OAAe,EAAE;IACrBG,OAAO,CAACC,KAAK,CAACL,aAAa,CAACC,OAAO,CAAC,CAAC;EACvC;AACF,CAAC","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/types.js b/frontend-admin/node_modules/react-native-worklets/lib/module/debug/types.js deleted file mode 100644 index 6e4bb72f..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/types.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/types.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/debug/types.js.map deleted file mode 100644 index 2f0f7e28..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/debug/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":[],"sourceRoot":"../../../src","sources":["debug/types.ts"],"mappings":"AAAA,YAAY","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/deprecated.js b/frontend-admin/node_modules/react-native-worklets/lib/module/deprecated.js index d899365a..45e230aa 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/deprecated.js +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/deprecated.js @@ -1,7 +1,7 @@ 'use strict'; -import { createSerializable, isSerializableRef, makeShareable, makeShareableCloneOnUIRecursive } from './memory/serializable'; -import { serializableMappingCache } from './memory/serializableMappingCache'; +import { createSerializable, isSerializableRef, makeShareable, makeShareableCloneOnUIRecursive } from "./serializable.js"; +import { serializableMappingCache } from "./serializableMappingCache.js"; /** @deprecated Use {@link SerializableRef} instead. */ diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/deprecated.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/deprecated.js.map index 2eafd349..4695c2e0 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/deprecated.js.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/deprecated.js.map @@ -1 +1 @@ -{"version":3,"names":["createSerializable","isSerializableRef","makeShareable","makeShareableCloneOnUIRecursive","serializableMappingCache","makeShareableCloneRecursive","isShareableRef","shareableMappingCache"],"sourceRoot":"../../src","sources":["deprecated.ts"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,kBAAkB,EAClBC,iBAAiB,EACjBC,aAAa,EACbC,+BAA+B,QAC1B,uBAAuB;AAC9B,SAASC,wBAAwB,QAAQ,mCAAmC;;AAG5E;;AAGA,SAASF,aAAa,EAAEC,+BAA+B;;AAEvD;;AAOA;AACA,OAAO,MAAME,2BAA+C,GAC1DL,kBAAkB;;AAEpB;AACA,OAAO,MAAMM,cAAc,GAAGL,iBAAiB;;AAE/C;AACA,OAAO,MAAMM,qBAAqB,GAAGH,wBAAwB","ignoreList":[]} +{"version":3,"names":["createSerializable","isSerializableRef","makeShareable","makeShareableCloneOnUIRecursive","serializableMappingCache","makeShareableCloneRecursive","isShareableRef","shareableMappingCache"],"sourceRoot":"../../src","sources":["deprecated.ts"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,kBAAkB,EAClBC,iBAAiB,EACjBC,aAAa,EACbC,+BAA+B,QAC1B,mBAAgB;AACvB,SAASC,wBAAwB,QAAQ,+BAA4B;;AAGrE;;AAGA,SAASF,aAAa,EAAEC,+BAA+B;;AAEvD;;AAOA;AACA,OAAO,MAAME,2BAA+C,GAC1DL,kBAAkB;;AAEpB;AACA,OAAO,MAAMM,cAAc,GAAGL,iBAAiB;;AAE/C;AACA,OAAO,MAAMM,qBAAqB,GAAGH,wBAAwB","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/featureFlags.js b/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/featureFlags.js deleted file mode 100644 index 26e3bef7..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/featureFlags.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -export function getStaticFeatureFlag(_name) { - return false; -} -export function setDynamicFeatureFlag(_name, _value) { - // no-op -} -export function getDynamicFeatureFlag(_name) { - return false; -} -//# sourceMappingURL=featureFlags.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/featureFlags.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/featureFlags.js.map deleted file mode 100644 index 125f4eb2..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/featureFlags.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["getStaticFeatureFlag","_name","setDynamicFeatureFlag","_value","getDynamicFeatureFlag"],"sourceRoot":"../../../src","sources":["featureFlags/featureFlags.ts"],"mappings":"AAAA,YAAY;;AAIZ,OAAO,SAASA,oBAAoBA,CAClCC,KAAqC,EAC5B;EACT,OAAO,KAAK;AACd;AAEA,OAAO,SAASC,qBAAqBA,CACnCD,KAAsB,EACtBE,MAAe,EACT;EACN;AAAA;AAGF,OAAO,SAASC,qBAAqBA,CAACH,KAAsB,EAAW;EACrE,OAAO,KAAK;AACd","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/featureFlags.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/featureFlags.native.js deleted file mode 100644 index 5b9c1024..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/featureFlags.native.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -import { logger } from '../debug/logger'; -import { WorkletsModule } from '../WorkletsModule/NativeWorklets'; -export const DynamicFlags = { - EXAMPLE_DYNAMIC_FLAG: true, - init() { - Object.keys(DynamicFlags).forEach(key => { - if (key !== 'init' && key !== 'setFlag' && key !== 'getFlag') { - WorkletsModule.setDynamicFeatureFlag(key, DynamicFlags[key]); - } - }); - }, - setFlag(name, value) { - if (name in DynamicFlags) { - DynamicFlags[name] = value; - WorkletsModule.setDynamicFeatureFlag(name, value); - } else { - logger.warn(`The feature flag: '${name}' no longer exists, you can safely remove invocation of \`setDynamicFeatureFlag('${name}')\` from your code.`); - } - }, - getFlag(name) { - if (name in DynamicFlags) { - return DynamicFlags[name]; - } else { - logger.warn(`The feature flag: '${name}' no longer exists, you can safely remove invocation of \`getDynamicFeatureFlag('${name}')\` from your code.`); - return false; - } - } -}; -DynamicFlags.init(); - -// Public API function to update a feature flag -export function setDynamicFeatureFlag(name, value) { - DynamicFlags.setFlag(name, value); -} - -// Public API function to read a feature flag -export function getDynamicFeatureFlag(name) { - return DynamicFlags.getFlag(name); -} -const staticFeatureFlags = {}; -export function getStaticFeatureFlag(name) { - if (name in staticFeatureFlags) { - return staticFeatureFlags[name]; - } - const featureFlagValue = WorkletsModule.getStaticFeatureFlag(name); - staticFeatureFlags[name] = featureFlagValue; - return featureFlagValue; -} -//# sourceMappingURL=featureFlags.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/featureFlags.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/featureFlags.native.js.map deleted file mode 100644 index 9734e9f0..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/featureFlags.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["logger","WorkletsModule","DynamicFlags","EXAMPLE_DYNAMIC_FLAG","init","Object","keys","forEach","key","setDynamicFeatureFlag","setFlag","name","value","warn","getFlag","getDynamicFeatureFlag","staticFeatureFlags","getStaticFeatureFlag","featureFlagValue"],"sourceRoot":"../../../src","sources":["featureFlags/featureFlags.native.ts"],"mappings":"AAAA,YAAY;;AACZ,SAASA,MAAM,QAAQ,iBAAiB;AACxC,SAASC,cAAc,QAAQ,kCAAkC;AAOjE,OAAO,MAAMC,YAA8B,GAAG;EAC5CC,oBAAoB,EAAE,IAAI;EAE1BC,IAAIA,CAAA,EAAG;IACLC,MAAM,CAACC,IAAI,CAACJ,YAAY,CAAC,CAACK,OAAO,CAAEC,GAAG,IAAK;MACzC,IAAIA,GAAG,KAAK,MAAM,IAAIA,GAAG,KAAK,SAAS,IAAIA,GAAG,KAAK,SAAS,EAAE;QAC5D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;AACzB","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/types.js b/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/types.js deleted file mode 100644 index 8e6f1bd1..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/types.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -/** - * This constant is needed for typechecking and preserving static typechecks in - * generated .d.ts files. Without it, the static flags resolve to an object - * without specific keys. - */ -export const DefaultStaticFeatureFlags = { - RUNTIME_TEST_FLAG: false, - IOS_DYNAMIC_FRAMERATE_ENABLED: false -}; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/types.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/types.js.map deleted file mode 100644 index d4149cfd..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/featureFlags/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["DefaultStaticFeatureFlags","RUNTIME_TEST_FLAG","IOS_DYNAMIC_FRAMERATE_ENABLED"],"sourceRoot":"../../../src","sources":["featureFlags/types.ts"],"mappings":"AAAA,YAAY;;AAgBZ;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,yBAAyB,GAAG;EACvCC,iBAAiB,EAAE,KAAK;EACxBC,6BAA6B,EAAE;AACjC,CAAkD","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/index.js b/frontend-admin/node_modules/react-native-worklets/lib/module/index.js index e8519747..a1f74615 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/index.js +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/index.js @@ -1,26 +1,26 @@ 'use strict'; -import { init } from './initializers/initializers'; -import { bundleModeInit } from './initializers/workletRuntimeEntry'; +import "./publicGlobals.js"; +import { init } from "./initializers.js"; +import { bundleModeInit } from "./workletRuntimeEntry.js"; init(); - +export { isShareableRef, makeShareable, makeShareableCloneOnUIRecursive, makeShareableCloneRecursive, shareableMappingCache } from "./deprecated.js"; +export { getStaticFeatureFlag, setDynamicFeatureFlag } from "./featureFlags/index.js"; +export { isSynchronizable } from "./isSynchronizable.js"; +export { getRuntimeKind, RuntimeKind } from "./runtimeKind.js"; +export { createWorkletRuntime, runOnRuntime } from "./runtimes.js"; +export { createSerializable, isSerializableRef } from "./serializable.js"; +export { serializableMappingCache } from "./serializableMappingCache.js"; +export { createSynchronizable } from "./synchronizable.js"; +export { callMicrotasks, executeOnUIRuntimeSync, runOnJS, runOnUI, runOnUIAsync, runOnUISync, scheduleOnRN, scheduleOnUI, +// eslint-disable-next-line camelcase +unstable_eventLoopTask } from "./threads.js"; +export { isWorkletFunction } from "./workletFunction.js"; +export { WorkletsModule } from "./WorkletsModule/index.js"; // @ts-expect-error We must trick the bundler to include // the `workletRuntimeEntry` file the way it cannot optimize it out. if (globalThis._ALWAYS_FALSE) { // Bundle mode. bundleModeInit(); } -export { isShareableRef, makeShareable, makeShareableCloneOnUIRecursive, makeShareableCloneRecursive, shareableMappingCache } from './deprecated'; -export { getDynamicFeatureFlag, getStaticFeatureFlag, setDynamicFeatureFlag } from './featureFlags/featureFlags'; -export { isSynchronizable } from './memory/isSynchronizable'; -export { createSerializable, isSerializableRef, registerCustomSerializable } from './memory/serializable'; -export { serializableMappingCache } from './memory/serializableMappingCache'; -export { createSynchronizable } from './memory/synchronizable'; -export { getRuntimeKind, RuntimeKind } from './runtimeKind'; -export { createWorkletRuntime, runOnRuntime, scheduleOnRuntime } from './runtimes'; -export { callMicrotasks, executeOnUIRuntimeSync, runOnJS, runOnUI, runOnUIAsync, runOnUISync, scheduleOnRN, scheduleOnUI, -// eslint-disable-next-line camelcase -unstable_eventLoopTask } from './threads'; -export { isWorkletFunction } from './workletFunction'; -export { WorkletsModule } from './WorkletsModule/NativeWorklets'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/index.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/index.js.map index 48ec7a15..633273ce 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/index.js.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/index.js.map @@ -1 +1 @@ -{"version":3,"names":["init","bundleModeInit","globalThis","_ALWAYS_FALSE","isShareableRef","makeShareable","makeShareableCloneOnUIRecursive","makeShareableCloneRecursive","shareableMappingCache","getDynamicFeatureFlag","getStaticFeatureFlag","setDynamicFeatureFlag","isSynchronizable","createSerializable","isSerializableRef","registerCustomSerializable","serializableMappingCache","createSynchronizable","getRuntimeKind","RuntimeKind","createWorkletRuntime","runOnRuntime","scheduleOnRuntime","callMicrotasks","executeOnUIRuntimeSync","runOnJS","runOnUI","runOnUIAsync","runOnUISync","scheduleOnRN","scheduleOnUI","unstable_eventLoopTask","isWorkletFunction","WorkletsModule"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,IAAI,QAAQ,6BAA6B;AAClD,SAASC,cAAc,QAAQ,oCAAoC;AAEnED,IAAI,CAAC,CAAC;;AAEN;AACA;AACA,IAAIE,UAAU,CAACC,aAAa,EAAE;EAC5B;EACAF,cAAc,CAAC,CAAC;AAClB;AAEA,SACEG,cAAc,EACdC,aAAa,EAEbC,+BAA+B,EAC/BC,2BAA2B,EAC3BC,qBAAqB,QAEhB,cAAc;AACrB,SACEC,qBAAqB,EACrBC,oBAAoB,EACpBC,qBAAqB,QAChB,6BAA6B;AACpC,SAASC,gBAAgB,QAAQ,2BAA2B;AAC5D,SACEC,kBAAkB,EAClBC,iBAAiB,EACjBC,0BAA0B,QACrB,uBAAuB;AAC9B,SAASC,wBAAwB,QAAQ,mCAAmC;AAC5E,SAASC,oBAAoB,QAAQ,yBAAyB;AAO9D,SAASC,cAAc,EAAEC,WAAW,QAAQ,eAAe;AAC3D,SACEC,oBAAoB,EACpBC,YAAY,EACZC,iBAAiB,QACZ,YAAY;AACnB,SACEC,cAAc,EACdC,sBAAsB,EACtBC,OAAO,EACPC,OAAO,EACPC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,YAAY;AACZ;AACAC,sBAAsB,QACjB,WAAW;AAMlB,SAASC,iBAAiB,QAAQ,mBAAmB;AACrD,SAASC,cAAc,QAAQ,iCAAiC","ignoreList":[]} +{"version":3,"names":["init","bundleModeInit","isShareableRef","makeShareable","makeShareableCloneOnUIRecursive","makeShareableCloneRecursive","shareableMappingCache","getStaticFeatureFlag","setDynamicFeatureFlag","isSynchronizable","getRuntimeKind","RuntimeKind","createWorkletRuntime","runOnRuntime","createSerializable","isSerializableRef","serializableMappingCache","createSynchronizable","callMicrotasks","executeOnUIRuntimeSync","runOnJS","runOnUI","runOnUIAsync","runOnUISync","scheduleOnRN","scheduleOnUI","unstable_eventLoopTask","isWorkletFunction","WorkletsModule","globalThis","_ALWAYS_FALSE"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,oBAAiB;AAExB,SAASA,IAAI,QAAQ,mBAAgB;AACrC,SAASC,cAAc,QAAQ,0BAAuB;AAEtDD,IAAI,CAAC,CAAC;AAGN,SACEE,cAAc,EACdC,aAAa,EACbC,+BAA+B,EAC/BC,2BAA2B,EAC3BC,qBAAqB,QAChB,iBAAc;AACrB,SAASC,oBAAoB,EAAEC,qBAAqB,QAAQ,yBAAgB;AAC5E,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAASC,cAAc,EAAEC,WAAW,QAAQ,kBAAe;AAC3D,SAASC,oBAAoB,EAAEC,YAAY,QAAQ,eAAY;AAC/D,SAASC,kBAAkB,EAAEC,iBAAiB,QAAQ,mBAAgB;AACtE,SAASC,wBAAwB,QAAQ,+BAA4B;AAErE,SAASC,oBAAoB,QAAQ,qBAAkB;AACvD,SACEC,cAAc,EACdC,sBAAsB,EACtBC,OAAO,EACPC,OAAO,EACPC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,YAAY;AACZ;AACAC,sBAAsB,QACjB,cAAW;AAClB,SAASC,iBAAiB,QAAQ,sBAAmB;AAErD,SAASC,cAAc,QAAQ,2BAAkB;AAQjD;AACA;AACA,IAAIC,UAAU,CAACC,aAAa,EAAE;EAC5B;EACA7B,cAAc,CAAC,CAAC;AAClB","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/initializers.js b/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/initializers.js deleted file mode 100644 index 4a8576b5..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/initializers.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -import { IS_JEST } from '../platformChecker'; -import { mockedRequestAnimationFrame } from '../runLoop/uiRuntime/mockedRequestAnimationFrame'; -import { RuntimeKind } from '../runtimeKind'; -export function init() { - globalThis._WORKLET = false; - globalThis.__RUNTIME_KIND = RuntimeKind.ReactNative; - globalThis._log = console.log; - globalThis._getAnimationTimestamp = () => performance.now(); - if (IS_JEST) { - // requestAnimationFrame react-native jest's setup is incorrect as it polyfills - // the method directly using setTimeout, therefore the callback doesn't get the - // expected timestamp as the only argument: https://github.com/facebook/react-native/blob/main/packages/react-native/jest/setup.js#L28 - // We override this setup here to make sure that callbacks get the proper timestamps - // when executed. For non-jest environments we define requestAnimationFrame in setupRequestAnimationFrame - // @ts-ignore TypeScript uses Node definition for rAF, setTimeout, etc which returns a Timeout object rather than a number - globalThis.requestAnimationFrame = mockedRequestAnimationFrame; - } -} -//# sourceMappingURL=initializers.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/initializers.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/initializers.js.map deleted file mode 100644 index c1bf7ac8..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/initializers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["IS_JEST","mockedRequestAnimationFrame","RuntimeKind","init","globalThis","_WORKLET","__RUNTIME_KIND","ReactNative","_log","console","log","_getAnimationTimestamp","performance","now","requestAnimationFrame"],"sourceRoot":"../../../src","sources":["initializers/initializers.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,2BAA2B,QAAQ,kDAAkD;AAC9F,SAASC,WAAW,QAAQ,gBAAgB;AAE5C,OAAO,SAASC,IAAIA,CAAA,EAAG;EACrBC,UAAU,CAACC,QAAQ,GAAG,KAAK;EAC3BD,UAAU,CAACE,cAAc,GAAGJ,WAAW,CAACK,WAAW;EACnDH,UAAU,CAACI,IAAI,GAAGC,OAAO,CAACC,GAAG;EAC7BN,UAAU,CAACO,sBAAsB,GAAG,MAAMC,WAAW,CAACC,GAAG,CAAC,CAAC;EAC3D,IAAIb,OAAO,EAAE;IACX;IACA;IACA;IACA;IACA;IACA;IACAI,UAAU,CAACU,qBAAqB,GAAGb,2BAA2B;EAChE;AACF","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/initializers.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/initializers.native.js deleted file mode 100644 index c41e64ad..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/initializers.native.js +++ /dev/null @@ -1,198 +0,0 @@ -'use strict'; - -import { setupCallGuard } from '../callGuard'; -import { registerReportFatalRemoteError } from '../debug/errors'; -import { registerWorkletsError, WorkletsError } from '../debug/WorkletsError'; -import { bundleValueUnpacker } from '../memory/bundleUnpacker'; -import { __installUnpacker as installCustomSerializableUnpacker } from '../memory/customSerializableUnpacker'; -import { __installUnpacker as installSynchronizableUnpacker } from '../memory/synchronizableUnpacker'; -import { setupSetImmediate } from '../runLoop/common/setImmediatePolyfill'; -import { setupSetInterval } from '../runLoop/common/setIntervalPolyfill'; -import { setupRequestAnimationFrame } from '../runLoop/uiRuntime/requestAnimationFrame'; -import { setupSetTimeout } from '../runLoop/uiRuntime/setTimeoutPolyfill'; -import { RuntimeKind } from '../runtimeKind'; -import { runOnUISync, scheduleOnRN, setupMicrotasks } from '../threads'; -import { isWorkletFunction } from '../workletFunction'; -import { WorkletsModule } from '../WorkletsModule/NativeWorklets'; -if (globalThis.__RUNTIME_KIND === undefined) { - // The only runtime that doesn't have `__RUNTIME_KIND` preconfigured - // is the RN Runtime. We must set it as soon as possible. - globalThis.__RUNTIME_KIND = RuntimeKind.ReactNative; -} -let capturableConsole; - -/** - * Currently there seems to be a bug in the JSI layer which causes a crash when - * we try to copy some of the console methods, i.e. `clear` or `dirxml`. - * - * The crash happens only in React Native 0.75. It's not reproducible in neither - * 0.76 nor 0.74. It also happens only in the configuration of a debug app and - * production bundle. - * - * I haven't yet discovered what exactly causes the crash. It's tied to the - * console methods sometimes being `HostFunction`s. Therefore, as a workaround - * we don't copy the methods as they are in the original console object, we copy - * JavaScript wrappers instead. - */ -export function getMemorySafeCapturableConsole() { - if (capturableConsole) { - return capturableConsole; - } - const consoleCopy = Object.fromEntries(Object.entries(console).map(([methodName, method]) => { - const methodWrapper = function methodWrapper(...args) { - return method(...args); - }; - if (method.name) { - /** - * Set the original method name as the wrapper name if available. - * - * It might be unnecessary but if we want to fully mimic the console - * object we should take into the account the fact some code might rely - * on the method name. - */ - Object.defineProperty(methodWrapper, 'name', { - value: method.name, - writable: false - }); - } - return [methodName, methodWrapper]; - })); - capturableConsole = consoleCopy; - return consoleCopy; -} -export function setupConsole(boundCapturableConsole) { - 'worklet'; - - // @ts-ignore TypeScript doesn't like that there are missing methods in console object, but we don't provide all the methods for the UI runtime console version - globalThis.console = { - assert: (...args) => scheduleOnRN(boundCapturableConsole.assert, ...args), - debug: (...args) => scheduleOnRN(boundCapturableConsole.debug, ...args), - log: (...args) => scheduleOnRN(boundCapturableConsole.log, ...args), - warn: (...args) => scheduleOnRN(boundCapturableConsole.warn, ...args), - error: (...args) => scheduleOnRN(boundCapturableConsole.error, ...args), - info: (...args) => scheduleOnRN(boundCapturableConsole.info, ...args) - }; -} -let initialized = false; -export function init() { - if (initialized) { - return; - } - initialized = true; - initializeRuntime(); - if (globalThis.__RUNTIME_KIND !== RuntimeKind.ReactNative) { - initializeWorkletRuntime(); - } else { - initializeRNRuntime(); - installRNBindingsOnUIRuntime(); - } -} - -/** A function that should be run on any kind of runtime. */ -function initializeRuntime() { - if (globalThis._WORKLETS_BUNDLE_MODE) { - globalThis.__valueUnpacker = bundleValueUnpacker; - } - installSynchronizableUnpacker(); - installCustomSerializableUnpacker(); -} - -/** A function that should be run only on React Native runtime. */ -function initializeRNRuntime() { - if (__DEV__) { - const testWorklet = () => { - 'worklet'; - }; - if (!isWorkletFunction(testWorklet)) { - throw new WorkletsError(`Failed to create a worklet. See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#failed-to-create-a-worklet for more details.`); - } - } - registerReportFatalRemoteError(); -} - -/** A function that should be run only on Worklet runtimes. */ -function initializeWorkletRuntime() { - if (globalThis._WORKLETS_BUNDLE_MODE) { - setupCallGuard(); - if (__DEV__) { - /* - * Temporary workaround for Metro bundler. We must implement a dummy - * Refresh module to prevent Metro from throwing irrelevant errors. - */ - const Refresh = new Proxy({}, { - get() { - return () => {}; - } - }); - globalThis.__r.Refresh = Refresh; - - /* Gracefully handle unwanted imports from React Native. */ - const modules = require.getModules(); - const ReactNativeModuleId = require.resolveWeak('react-native'); - const factory = function (_global, _require, _importDefault, _importAll, module, _exports, _dependencyMap) { - module.exports = new Proxy({}, { - get: function get(_target, prop) { - globalThis.console.warn(`You tried to import '${String(prop)}' from 'react-native' module on a Worklet Runtime. Using 'react-native' module on a Worklet Runtime is not allowed.`); - return { - get() { - return undefined; - } - }; - } - }); - }; - const mod = { - dependencyMap: [], - factory, - hasError: false, - importedAll: {}, - importedDefault: {}, - isInitialized: false, - publicModule: { - exports: {} - } - }; - modules.set(ReactNativeModuleId, mod); - } - } -} - -/** - * A function that should be run on the RN Runtime to configure the UI Runtime - * with callback bindings. - */ -function installRNBindingsOnUIRuntime() { - if (!WorkletsModule) { - throw new WorkletsError('Worklets are trying to initialize the UI runtime without a valid WorkletsModule'); - } - const runtimeBoundCapturableConsole = getMemorySafeCapturableConsole(); - if (!globalThis._WORKLETS_BUNDLE_MODE) { - /** In bundle mode Runtimes setup their callGuard themselves. */ - runOnUISync(setupCallGuard); - - /** - * Register WorkletsError in the UI runtime global scope. (we are using - * `executeOnUIRuntimeSync` here to make sure that the changes are applied - * before any async operations are executed on the UI runtime). - * - * There's no need to register the error in bundle mode. - */ - runOnUISync(registerWorkletsError); - } - runOnUISync(() => { - 'worklet'; - - setupConsole(runtimeBoundCapturableConsole); - /** - * TODO: Move `setupMicrotasks` and `setupRequestAnimationFrame` to a - * separate function once we have a better way to distinguish between - * Worklet Runtimes. - */ - setupMicrotasks(); - setupRequestAnimationFrame(); - setupSetTimeout(); - setupSetImmediate(); - setupSetInterval(); - }); -} -//# sourceMappingURL=initializers.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/initializers.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/initializers.native.js.map deleted file mode 100644 index bffc0ed2..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/initializers.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["setupCallGuard","registerReportFatalRemoteError","registerWorkletsError","WorkletsError","bundleValueUnpacker","__installUnpacker","installCustomSerializableUnpacker","installSynchronizableUnpacker","setupSetImmediate","setupSetInterval","setupRequestAnimationFrame","setupSetTimeout","RuntimeKind","runOnUISync","scheduleOnRN","setupMicrotasks","isWorkletFunction","WorkletsModule","globalThis","__RUNTIME_KIND","undefined","ReactNative","capturableConsole","getMemorySafeCapturableConsole","consoleCopy","Object","fromEntries","entries","console","map","methodName","method","methodWrapper","args","name","defineProperty","value","writable","setupConsole","boundCapturableConsole","assert","debug","log","warn","error","info","initialized","init","initializeRuntime","initializeWorkletRuntime","initializeRNRuntime","installRNBindingsOnUIRuntime","_WORKLETS_BUNDLE_MODE","__valueUnpacker","__DEV__","testWorklet","Refresh","Proxy","get","__r","modules","require","getModules","ReactNativeModuleId","resolveWeak","factory","_global","_require","_importDefault","_importAll","module","_exports","_dependencyMap","exports","_target","prop","String","mod","dependencyMap","hasError","importedAll","importedDefault","isInitialized","publicModule","set","runtimeBoundCapturableConsole"],"sourceRoot":"../../../src","sources":["initializers/initializers.native.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,cAAc,QAAQ,cAAc;AAC7C,SAASC,8BAA8B,QAAQ,iBAAiB;AAChE,SAASC,qBAAqB,EAAEC,aAAa,QAAQ,wBAAwB;AAC7E,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,iBAAiB,IAAIC,iCAAiC,QAAQ,sCAAsC;AAC7G,SAASD,iBAAiB,IAAIE,6BAA6B,QAAQ,kCAAkC;AACrG,SAASC,iBAAiB,QAAQ,wCAAwC;AAC1E,SAASC,gBAAgB,QAAQ,uCAAuC;AACxE,SAASC,0BAA0B,QAAQ,4CAA4C;AACvF,SAASC,eAAe,QAAQ,yCAAyC;AACzE,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,WAAW,EAAEC,YAAY,EAAEC,eAAe,QAAQ,YAAY;AAEvE,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,cAAc,QAAQ,kCAAkC;AAEjE,IAAIC,UAAU,CAACC,cAAc,KAAKC,SAAS,EAAE;EAC3C;EACA;EACAF,UAAU,CAACC,cAAc,GAAGP,WAAW,CAACS,WAAW;AACrD;AAEA,IAAIC,iBAAiC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,8BAA8BA,CAAA,EAAmB;EAC/D,IAAID,iBAAiB,EAAE;IACrB,OAAOA,iBAAiB;EAC1B;EAEA,MAAME,WAAW,GAAGC,MAAM,CAACC,WAAW,CACpCD,MAAM,CAACE,OAAO,CAACC,OAAO,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,UAAU,EAAEC,M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C;AACJ;AACA;AACA;AACA;IACItE,eAAe,CAAC,CAAC;IACjBL,0BAA0B,CAAC,CAAC;IAC5BC,eAAe,CAAC,CAAC;IACjBH,iBAAiB,CAAC,CAAC;IACnBC,gBAAgB,CAAC,CAAC;EACpB,CAAC,CAAC;AACJ","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/workletRuntimeEntry.js b/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/workletRuntimeEntry.js deleted file mode 100644 index 8ab8bbfd..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/workletRuntimeEntry.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -export function bundleModeInit() { - // no-op -} -//# sourceMappingURL=workletRuntimeEntry.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/workletRuntimeEntry.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/workletRuntimeEntry.js.map deleted file mode 100644 index 18dfce37..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/workletRuntimeEntry.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["bundleModeInit"],"sourceRoot":"../../../src","sources":["initializers/workletRuntimeEntry.ts"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,SAASA,cAAcA,CAAA,EAAG;EAC/B;AAAA","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/workletRuntimeEntry.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/workletRuntimeEntry.native.js deleted file mode 100644 index 8a6691e0..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/workletRuntimeEntry.native.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -import { WorkletsError } from '../debug/WorkletsError'; -import { RuntimeKind } from '../runtimeKind'; -import { init } from './initializers'; - -/** - * This function is an entry point for Worklet Runtimes. We can use it to setup - * necessary tools, like the ValueUnpacker. - * - * We must throw an error at the end of this function to prevent the bundle to - * continue executing. This is because the next module to be ran would be the - * React Native one, and it would break the Worklet Runtime if initialized. The - * error is caught in C++ code. - * - * This function has no effect on the RN Runtime beside setting the - * `_WORKLETS_BUNDLE_MODE` flag. - */ -export function bundleModeInit() { - // Worklets Babel Plugin replaces `false` with `true` here - // when Bundle Mode is enabled. - globalThis._WORKLETS_BUNDLE_MODE = false; - if (!globalThis._WORKLETS_BUNDLE_MODE) { - return; - } - const runtimeKind = globalThis.__RUNTIME_KIND; - if (runtimeKind && runtimeKind !== RuntimeKind.ReactNative) { - /** - * We shouldn't call `init()` on RN Runtime here, as it would initialize our - * module before React Native has configured the RN Runtime. - */ - init(); - throw new WorkletsError('Worklets initialized successfully'); - } -} -bundleModeInit(); -//# sourceMappingURL=workletRuntimeEntry.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/workletRuntimeEntry.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/workletRuntimeEntry.native.js.map deleted file mode 100644 index b7af4385..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/initializers/workletRuntimeEntry.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["WorkletsError","RuntimeKind","init","bundleModeInit","globalThis","_WORKLETS_BUNDLE_MODE","runtimeKind","__RUNTIME_KIND","ReactNative"],"sourceRoot":"../../../src","sources":["initializers/workletRuntimeEntry.native.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,aAAa,QAAQ,wBAAwB;AACtD,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,IAAI,QAAQ,gBAAgB;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAG;EAC/B;EACA;EACAC,UAAU,CAACC,qBAAqB,GAAG,KAAK;EAExC,IAAI,CAACD,UAAU,CAACC,qBAAqB,EAAE;IACrC;EACF;EAEA,MAAMC,WAAW,GAAGF,UAAU,CAACG,cAAc;EAC7C,IAAID,WAAW,IAAIA,WAAW,KAAKL,WAAW,CAACO,WAAW,EAAE;IAC1D;AACJ;AACA;AACA;IACIN,IAAI,CAAC,CAAC;IACN,MAAM,IAAIF,aAAa,CAAC,mCAAmC,CAAC;EAC9D;AACF;AAEAG,cAAc,CAAC,CAAC","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/bundleUnpacker.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/bundleUnpacker.native.js deleted file mode 100644 index 6cb9aebd..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/bundleUnpacker.native.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -import { logger } from '../debug/logger'; -import { WorkletsError } from '../debug/WorkletsError'; -const handleCache = new WeakMap(); -export function bundleValueUnpacker(objectToUnpack, category, remoteFunctionName) { - const workletHash = objectToUnpack.__workletHash; - if (workletHash !== undefined) { - return getWorklet(workletHash, objectToUnpack.__closure); - } else if (objectToUnpack.__init !== undefined) { - let value = handleCache.get(objectToUnpack); - if (value === undefined) { - value = objectToUnpack.__init(); - handleCache.set(objectToUnpack, value); - } - return value; - } else if (category === 'RemoteFunction') { - const remoteFunctionHolder = () => { - const label = remoteFunctionName ? `function \`${remoteFunctionName}\`` : 'anonymous function'; - throw new WorkletsError(`Tried to synchronously call a non-worklet ${label} on the UI thread. -See https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#tried-to-synchronously-call-a-non-worklet-function-on-the-ui-thread for more details.`); - }; - remoteFunctionHolder.__remoteFunction = objectToUnpack; - return remoteFunctionHolder; - } else { - throw new WorkletsError(`Data type in category "${category}" not recognized by value unpacker: "${globalThis._toString(objectToUnpack)}".`); - } -} -function getWorklet(workletHash, closureVariables) { - let worklet; - if (__DEV__) { - try { - worklet = getWorkletFromMetroRequire(workletHash, closureVariables); - } catch (_e) { - logger.error('Unable to resolve worklet with hash ' + workletHash + '. Try reloading the app.'); - } - } else { - worklet = getWorkletFromMetroRequire(workletHash, closureVariables); - } - return worklet; -} -const metroRequire = globalThis.__r; -function getWorkletFromMetroRequire(workletHash, closureVariables) { - const factory = metroRequire(workletHash).default; - return factory(closureVariables); -} -//# sourceMappingURL=bundleUnpacker.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/bundleUnpacker.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/bundleUnpacker.native.js.map deleted file mode 100644 index 235be622..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/bundleUnpacker.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["logger","WorkletsError","handleCache","WeakMap","bundleValueUnpacker","objectToUnpack","category","remoteFunctionName","workletHash","__workletHash","undefined","getWorklet","__closure","__init","value","get","set","remoteFunctionHolder","label","__remoteFunction","globalThis","_toString","closureVariables","worklet","__DEV__","getWorkletFromMetroRequire","_e","error","metroRequire","__r","factory","default"],"sourceRoot":"../../../src","sources":["memory/bundleUnpacker.native.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,MAAM,QAAQ,iBAAiB;AACxC,SAASC,aAAa,QAAQ,wBAAwB;AAGtD,MAAMC,WAAW,GAAG,IAAIC,OAAO,CAA2B,CAAC;AAE3D,OAAO,SAASC,mBAAmBA,CACjCC,cAA8B,EAC9BC,QAAiB,EACjBC,kBAA2B,EAClB;EACT,MAAMC,WAAW,GAAGH,cAAc,CAACI,aAAa;EAChD,IAAID,WAAW,KAAKE,SAAS,EAAE;IAC7B,OAAOC,UAAU,CAACH,WAAW,EAAEH,cAAc,CAACO,SAAS,CAAC;EAC1D,CAAC,MAAM,IAAIP,cAAc,CAACQ,MAAM,KAAKH,SAAS,EAAE;IAC9C,IAAII,KAAK,GAAGZ,WAAW,CAACa,GAAG,CAACV,cAAc,CAAC;IAC3C,IAAIS,KAAK,KAAKJ,SAAS,EAAE;MACvBI,KAAK,GAAGT,cAAc,CAACQ,MAAM,CAAC,CAAC;MAC/BX,WAAW,CAACc,GAAG,CAACX,cAAc,EAAES,KAAK,CAAC;IACxC;IACA,OAAOA,KAAK;EACd,CAAC,MAAM,IAAIR,QAAQ,KAAK,gBAAgB,EAAE;IACxC,MAAMW,oBAAoB,GAAGA,CAAA,KAAM;MACjC,MAAMC,KAAK,GAAGX,kBAAkB,GAC5B,cAAcA,kBAAkB,IAAI,GACpC,oBAAoB;MACxB,MAAM,IAAIN,aAAa,CAAC,6CAA6CiB,KAAK;AAChF,uKAAuK,CAAC;IACpK,CAAC;IACDD,oBAAoB,CAACE,gBAAgB,GAAGd,cAAc;IACtD,OAAOY,oBAAoB;EAC7B,CAAC,MAAM;IACL,MAAM,IAAIhB,aAAa,CACrB,0BAA0BK,QAAQ,wCAAwCc,UAAU,CAACC,SAAS,CAC5FhB,cACF,CAAC,IACH,CAAC;EACH;AACF;AAEA,SAASM,UAAUA,CACjBH,WAAmB,EACnBc,gBAAyC,EACZ;EAC7B,IAAIC,OAAO;EACX,IAAIC,OAAO,EAAE;IACX,IAAI;MACFD,OAAO,GAAGE,0BAA0B,CAACjB,WAAW,EAAEc,gBAAgB,CAAC;IACrE,CAAC,CAAC,OAAOI,EAAE,EAAE;MACX1B,MAAM,CAAC2B,KAAK,CACV,sCAAsC,GACpCnB,WAAW,GACX,0BACJ,CAAC;IACH;EACF,CAAC,MAAM;IACLe,OAAO,GAAGE,0BAA0B,CAACjB,WAAW,EAAEc,gBAAgB,CAAC;EACrE;EACA,OAAOC,OAAO;AAChB;AAEA,MAAMK,YAAY,GAAGR,UAAU,CAACS,GAAG;AAEnC,SAASJ,0BAA0BA,CACjCjB,WAAmB,EACnBc,gBAAyC,EACxB;EACjB,MAAMQ,OAAO,GAAGF,YAAY,CAACpB,WAAW,CAAC,CAACuB,OAAyB;EACnE,OAAOD,OAAO,CAACR,gBAAgB,CAAC;AAClC","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/customSerializableUnpacker.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/customSerializableUnpacker.native.js deleted file mode 100644 index 85fcdfe9..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/customSerializableUnpacker.native.js +++ /dev/null @@ -1,18 +0,0 @@ -/* eslint-disable reanimated/use-worklets-error */ -'use strict'; - -export function __installUnpacker() { - if (!globalThis.__customSerializationRegistry) { - globalThis.__customSerializationRegistry = []; - } - const registry = globalThis.__customSerializationRegistry; - function customSerializableUnpacker(value, typeId) { - const data = registry[typeId]; - if (!data) { - throw new Error(`[Worklets] No custom serializable registered for type ID ${typeId}.`); - } - return data.unpack(value); - } - globalThis.__customSerializableUnpacker = customSerializableUnpacker; -} -//# sourceMappingURL=customSerializableUnpacker.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/customSerializableUnpacker.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/customSerializableUnpacker.native.js.map deleted file mode 100644 index f475b033..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/customSerializableUnpacker.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["__installUnpacker","globalThis","__customSerializationRegistry","registry","customSerializableUnpacker","value","typeId","data","Error","unpack","__customSerializableUnpacker"],"sourceRoot":"../../../src","sources":["memory/customSerializableUnpacker.native.ts"],"mappings":"AAAA;AACA,YAAY;;AAEZ,OAAO,SAASA,iBAAiBA,CAAA,EAAG;EAClC,IAAI,CAACC,UAAU,CAACC,6BAA6B,EAAE;IAC7CD,UAAU,CAACC,6BAA6B,GACtC,EAAqD;EACzD;EACA,MAAMC,QAAQ,GAAGF,UAAU,CAACC,6BAA6B;EAEzD,SAASE,0BAA0BA,CAASC,KAAa,EAAEC,MAAc,EAAE;IACzE,MAAMC,IAAI,GAAGJ,QAAQ,CAACG,MAAM,CAAC;IAC7B,IAAI,CAACC,IAAI,EAAE;MACT,MAAM,IAAIC,KAAK,CACb,4DAA4DF,MAAM,GACpE,CAAC;IACH;IAEA,OAAOC,IAAI,CAACE,MAAM,CAACJ,KAAe,CAAC;EACrC;EAEAJ,UAAU,CAACS,4BAA4B,GACrCN,0BAAwD;AAC5D","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/isSynchronizable.js b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/isSynchronizable.js deleted file mode 100644 index ce6f5032..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/isSynchronizable.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -import { WorkletsError } from '../debug/WorkletsError'; -export function isSynchronizable(_value) { - throw new WorkletsError('`isSynchronizable` is not supported on web.'); -} -//# sourceMappingURL=isSynchronizable.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/isSynchronizable.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/isSynchronizable.js.map deleted file mode 100644 index 5019c2ab..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/isSynchronizable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["WorkletsError","isSynchronizable","_value"],"sourceRoot":"../../../src","sources":["memory/isSynchronizable.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,aAAa,QAAQ,wBAAwB;AAGtD,OAAO,SAASC,gBAAgBA,CAC9BC,MAAe,EACmB;EAClC,MAAM,IAAIF,aAAa,CAAC,6CAA6C,CAAC;AACxE","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/isSynchronizable.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/isSynchronizable.native.js deleted file mode 100644 index dc8b3918..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/isSynchronizable.native.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -export function isSynchronizable(value) { - 'worklet'; - - return typeof value === 'object' && value !== null && '__synchronizableRef' in value && value.__synchronizableRef === true; -} -//# sourceMappingURL=isSynchronizable.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/isSynchronizable.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/isSynchronizable.native.js.map deleted file mode 100644 index 41e041e2..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/isSynchronizable.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["isSynchronizable","value","__synchronizableRef"],"sourceRoot":"../../../src","sources":["memory/isSynchronizable.native.ts"],"mappings":"AAAA,YAAY;;AAIZ,OAAO,SAASA,gBAAgBA,CAC9BC,KAAc,EACmB;EACjC,SAAS;;EACT,OACE,OAAOA,KAAK,KAAK,QAAQ,IACzBA,KAAK,KAAK,IAAI,IACd,qBAAqB,IAAIA,KAAK,IAC9BA,KAAK,CAACC,mBAAmB,KAAK,IAAI;AAEtC","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializable.js b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializable.js deleted file mode 100644 index 1b55dbab..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializable.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -export function isSerializableRef(value) { - return true; -} -export function createSerializable(value) { - return value; -} -export function makeShareableCloneOnUIRecursive(value) { - return value; -} -export function makeShareable(value) { - return value; -} -export function registerCustomSerializable(_registrationData) { - // noop -} -//# sourceMappingURL=serializable.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializable.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializable.js.map deleted file mode 100644 index 7d1b45b0..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["isSerializableRef","value","createSerializable","makeShareableCloneOnUIRecursive","makeShareable","registerCustomSerializable","_registrationData"],"sourceRoot":"../../../src","sources":["memory/serializable.ts"],"mappings":"AAAA,YAAY;;AAQZ,OAAO,SAASA,iBAAiBA,CAC/BC,KAAc,EACoB;EAClC,OAAO,IAAI;AACb;AAEA,OAAO,SAASC,kBAAkBA,CAChCD,KAAa,EACY;EACzB,OAAOA,KAAK;AACd;AAEA,OAAO,SAASE,+BAA+BA,CAC7CF,KAAa,EACgB;EAC7B,OAAOA,KAAK;AACd;AAEA,OAAO,SAASG,aAAaA,CAASH,KAAa,EAAU;EAC3D,OAAOA,KAAK;AACd;AAEA,OAAO,SAASI,0BAA0BA,CAGxCC,iBAAoD,EAAE;EACtD;AAAA","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializable.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializable.native.js deleted file mode 100644 index 274d5759..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializable.native.js +++ /dev/null @@ -1,631 +0,0 @@ -'use strict'; - -import { registerWorkletStackDetails } from '../debug/errors'; -import { jsVersion } from '../debug/jsVersion'; -import { logger } from '../debug/logger'; -import { WorkletsError } from '../debug/WorkletsError'; -import { getRuntimeKind, RuntimeKind } from '../runtimeKind'; -import { isWorkletFunction } from '../workletFunction'; -import { WorkletsModule } from '../WorkletsModule/NativeWorklets'; -import { isSynchronizable } from './isSynchronizable'; -import { serializableMappingCache, serializableMappingFlag } from './serializableMappingCache'; -const MAGIC_KEY = 'REANIMATED_MAGIC_KEY'; -function isHostObject(value) { - 'worklet'; - - // We could use JSI to determine whether an object is a host object, however - // the below workaround works well and is way faster than an additional JSI call. - // We use the fact that host objects have broken implementation of `hasOwnProperty` - // and hence return true for all `in` checks regardless of the key we ask for. - return MAGIC_KEY in value; -} -export function isSerializableRef(value) { - 'worklet'; - - return typeof value === 'object' && value !== null && '__serializableRef' in value && value.__serializableRef === true; -} -function isPlainJSObject(object) { - 'worklet'; - - return Object.getPrototypeOf(object) === Object.prototype; -} -function isTurboModuleLike(object) { - return isHostObject(Object.getPrototypeOf(object)); -} -function getFromCache(value) { - const cached = serializableMappingCache.get(value); - if (cached === serializableMappingFlag) { - // This means that `value` was already a clone and we should return it as is. - return value; - } - return cached; -} - -// The below object is used as a replacement for objects that cannot be transferred -// as serializable values. In createSerializable we detect if an object is of -// a plain Object.prototype and only allow such objects to be transferred. This lets -// us avoid all sorts of react internals from leaking into the UI runtime. To make it -// possible to catch errors when someone actually tries to access such object on the UI -// runtime, we use the below Proxy object which is instantiated on the UI runtime and -// throws whenever someone tries to access its fields. -const INACCESSIBLE_OBJECT = { - __init: () => { - 'worklet'; - - return new Proxy({}, { - get: (_, prop) => { - if (prop === '_isReanimatedSharedValue' || prop === '__remoteFunction' || prop === '__synchronizableRef') { - // not very happy about this check here, but we need to allow for - // "inaccessible" objects to be tested with isSerializableRef check - // as it is being used in the mappers when extracting inputs recursively - // as well as with isRemoteFunction when cloning objects recursively. - // Apparently we can't check if a key exists there as HostObjects always - // return true for such tests, so the only possibility for us is to - // actually access that key and see if it is set to true. We therefore - // need to allow for this key to be accessed here. - return false; - } - throw new WorkletsError(`Trying to access property \`${String(prop)}\` of an object which cannot be sent to the UI runtime.`); - }, - set: () => { - throw new WorkletsError('Trying to write to an object which cannot be sent to the UI runtime.'); - } - }); - } -}; -const VALID_ARRAY_VIEWS_NAMES = ['Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array', 'Float64Array', 'BigInt64Array', 'BigUint64Array', 'DataView']; -const DETECT_CYCLIC_OBJECT_DEPTH_THRESHOLD = 30; -// Below variable stores object that we process in createSerializable at the specified depth. -// We use it to check if later on the function reenters with the same object -let processedObjectAtThresholdDepth; -export function createSerializable(value, shouldPersistRemote = false, depth = 0) { - detectCyclicObject(value, depth); - const isObject = typeof value === 'object'; - const isFunction = typeof value === 'function'; - if (typeof value === 'string') { - return cloneString(value); - } - if (typeof value === 'number') { - return cloneNumber(value); - } - if (typeof value === 'boolean') { - return cloneBoolean(value); - } - if (typeof value === 'bigint') { - return cloneBigInt(value); - } - if (value === undefined) { - return cloneUndefined(); - } - if (value === null) { - return cloneNull(); - } - if (!isObject && !isFunction || value === null) { - return clonePrimitive(value, shouldPersistRemote); - } - const cached = getFromCache(value); - if (cached !== undefined) { - return cached; - } - if (Array.isArray(value)) { - return cloneArray(value, shouldPersistRemote, depth); - } - if (globalThis._WORKLETS_BUNDLE_MODE && isFunction && value.__bundleData) { - return cloneImport(value); - } - if (isFunction && !isWorkletFunction(value)) { - return cloneRemoteFunction(value); - } - // RN has introduced a new representation of TurboModules as a JS object whose prototype is the host object - // More details: https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp#L182 - if (isTurboModuleLike(value)) { - return cloneTurboModuleLike(value, shouldPersistRemote, depth); - } - if (isHostObject(value)) { - return cloneHostObject(value); - } - if (isPlainJSObject(value) && value.__init) { - return cloneInitializer(value, shouldPersistRemote, depth); - } - if (isPlainJSObject(value) && value.__workletContextObjectFactory) { - return cloneContextObject(value); - } - if ((isPlainJSObject(value) || isFunction) && isWorkletFunction(value)) { - return cloneWorklet(value, shouldPersistRemote, depth); - } - if (isSynchronizable(value)) { - return cloneSynchronizable(value); - } - if (isPlainJSObject(value) || isFunction) { - return clonePlainJSObject(value, shouldPersistRemote, depth); - } - if (value instanceof Set) { - return cloneSet(value); - } - if (value instanceof Map) { - return cloneMap(value); - } - if (value instanceof RegExp) { - return cloneRegExp(value); - } - if (value instanceof Error) { - return cloneError(value); - } - if (value instanceof ArrayBuffer) { - return cloneArrayBuffer(value, shouldPersistRemote); - } - if (ArrayBuffer.isView(value)) { - // typed array (e.g. Int32Array, Uint8ClampedArray) or DataView - return cloneArrayBufferView(value); - } - for (let i = 0; i < customSerializationRegistry.length; i++) { - const { - determine, - pack - } = customSerializationRegistry[i]; - if (determine(value)) { - return cloneCustom(value, pack, i); - } - } - return inaccessibleObject(value); -} -if (globalThis._WORKLETS_BUNDLE_MODE) { - // TODO: Do it programmatically. - createSerializable.__bundleData = { - imported: 'createSerializable', - source: require.resolveWeak('react-native-worklets') - }; -} -if (!globalThis.__customSerializationRegistry) { - globalThis.__customSerializationRegistry = []; -} -const customSerializationRegistry = globalThis.__customSerializationRegistry; - -/** - * `registerCustomSerializable` lets you register your own pre-serialization and - * post-deserialization logic. This is necessary for objects with prototypes - * different than just `Object.prototype` or some other built-in prototypes like - * `Map` etc. Worklets can't handle such objects by default to convert into - * [Serializables](https://docs.swmansion.com/react-native-worklets/docs/memory/serializable) - * hence you need to register them as **Custom Serializables**. This way you can - * tell Worklets how to transfer your custom data structures between different - * Runtimes without manually serializing and deserializing them every time. - * - * @param registrationData - The registration data for the custom serializable - - * {@link RegistrationData} - * @see https://docs.swmansion.com/react-native-worklets/docs/memory/registerCustomSerializable/ - */ -export function registerCustomSerializable(registrationData) { - if (__DEV__ && getRuntimeKind() !== RuntimeKind.ReactNative) { - throw new WorkletsError('registerCustomSerializable can be used only on React Native runtime.'); - } - const { - name, - determine, - pack, - unpack - } = registrationData; - if (__DEV__) { - verifyRegistrationData(determine, pack, unpack); - } - if (customSerializationRegistry.some(data => data.name === name)) { - if (__DEV__) { - console.warn(`Custom serializable with name "${name}" is already registered. Duplicate registration is ignored.`); - } - return; - } - customSerializationRegistry.push(registrationData); - WorkletsModule.registerCustomSerializable(createSerializable(determine), createSerializable(pack), createSerializable(unpack), customSerializationRegistry.length - 1); -} -function verifyRegistrationData(determine, pack, unpack) { - if (!isWorkletFunction(determine)) { - throw new WorkletsError('The "determine" function provided to registerCustomSerializable must be a worklet.'); - } - if (!isWorkletFunction(pack)) { - throw new WorkletsError('The "pack" function provided to registerCustomSerializable must be a worklet.'); - } - if (!isWorkletFunction(unpack)) { - throw new WorkletsError('The "unpack" function provided to registerCustomSerializable must be a worklet.'); - } -} -function detectCyclicObject(value, depth) { - if (depth >= DETECT_CYCLIC_OBJECT_DEPTH_THRESHOLD) { - // if we reach certain recursion depth we suspect that we are dealing with a cyclic object. - // this type of objects are not supported and cannot be transferred as serializable, so we - // implement a simple detection mechanism that remembers the value at a given depth and - // tests whether we try reenter this method later on with the same value. If that happens - // we throw an appropriate error. - if (depth === DETECT_CYCLIC_OBJECT_DEPTH_THRESHOLD) { - processedObjectAtThresholdDepth = value; - } else if (value === processedObjectAtThresholdDepth) { - throw new WorkletsError('Trying to convert a cyclic object to a serializable. This is not supported.'); - } - } else { - processedObjectAtThresholdDepth = undefined; - } -} -function clonePrimitive(value, shouldPersistRemote) { - return WorkletsModule.createSerializable(value, shouldPersistRemote); -} -function cloneString(value) { - return WorkletsModule.createSerializableString(value); -} -function cloneNumber(value) { - return WorkletsModule.createSerializableNumber(value); -} -function cloneBoolean(value) { - return WorkletsModule.createSerializableBoolean(value); -} -function cloneBigInt(value) { - return WorkletsModule.createSerializableBigInt(value); -} -function cloneUndefined() { - return WorkletsModule.createSerializableUndefined(); -} -function cloneNull() { - return WorkletsModule.createSerializableNull(); -} -function cloneObjectProperties(value, shouldPersistRemote, depth) { - const clonedProps = {}; - for (const [key, element] of Object.entries(value)) { - // We don't need to clone __initData field as it contains long strings - // representing the worklet code, source map, and location, and we will - // serialize/deserialize it once. - if (key === '__initData' && clonedProps.__initData !== undefined) { - continue; - } - clonedProps[key] = createSerializable(element, shouldPersistRemote, depth + 1); - } - return clonedProps; -} -function cloneInitializer(value, shouldPersistRemote = false, depth = 0) { - const clonedProps = cloneObjectProperties(value, shouldPersistRemote, depth); - return WorkletsModule.createSerializableInitializer(clonedProps); -} -function cloneArray(value, shouldPersistRemote, depth) { - const clonedElements = value.map(element => createSerializable(element, shouldPersistRemote, depth + 1)); - const clone = WorkletsModule.createSerializableArray(clonedElements, shouldPersistRemote); - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - freezeObjectInDev(value); - return clone; -} -function cloneRemoteFunction(value) { - const clone = WorkletsModule.createSerializableFunction(value); - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - freezeObjectInDev(value); - return clone; -} -function cloneHostObject(value) { - // for host objects we pass the reference to the object as serializable and - // then recreate new host object wrapping the same instance on the UI thread. - // there is no point of iterating over keys as we do for regular objects. - const clone = WorkletsModule.createSerializableHostObject(value); - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - return clone; -} -function cloneWorklet(value, shouldPersistRemote, depth) { - if (__DEV__) { - const babelVersion = value.__pluginVersion; - if (babelVersion !== undefined && babelVersion !== jsVersion) { - throw new WorkletsError(`Mismatch between JavaScript code version and Worklets Babel plugin version (${jsVersion} vs. ${babelVersion}). - See \`https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#mismatch-between-javascript-code-version-and-worklets-babel-plugin-version\` for more details. - Offending code was: \`${getWorkletCode(value)}\``); - } - registerWorkletStackDetails(value.__workletHash, value.__stackDetails); - } - if (value.__stackDetails) { - // `Error` type of value cannot be copied to the UI thread, so we - // remove it after we handled it in dev mode or delete it to ignore it in production mode. - // Not removing this would cause an infinite loop in production mode and it just - // seems more elegant to handle it this way. - delete value.__stackDetails; - } - const clonedProps = cloneObjectProperties(value, true, depth); - // to save on transferring static __initData field of worklet structure - // we request serializable value to persist its UI counterpart. This means - // that the __initData field that contains long strings representing the - // worklet code, source map, and location, will always be - // serialized/deserialized once. - clonedProps.__initData = createSerializable(value.__initData, true, depth + 1); - const clone = WorkletsModule.createSerializableWorklet(clonedProps, - // TODO: Check after refactor if we can remove shouldPersistRemote parameter (imho it's redundant here since worklets are always persistent) - // retain all worklets - true); - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - freezeObjectInDev(value); - return clone; -} - -/** - * TurboModuleLike objects are JS objects that have a TurboModule as their - * prototype. - */ -function cloneTurboModuleLike(value, shouldPersistRemote, depth) { - const proto = Object.getPrototypeOf(value); - const clonedProps = cloneObjectProperties(value, shouldPersistRemote, depth); - const clone = WorkletsModule.createSerializableTurboModuleLike(clonedProps, proto); - return clone; -} -function cloneContextObject(value) { - const workletContextObjectFactory = value.__workletContextObjectFactory; - const handle = cloneInitializer({ - __init: () => { - 'worklet'; - - return workletContextObjectFactory(); - } - }); - serializableMappingCache.set(value, handle); - return handle; -} -function clonePlainJSObject(value, shouldPersistRemote, depth) { - const clonedProps = cloneObjectProperties(value, shouldPersistRemote, depth); - const clone = WorkletsModule.createSerializableObject(clonedProps, shouldPersistRemote, value); - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - freezeObjectInDev(value); - return clone; -} -function cloneMap(value) { - const clonedKeys = []; - const clonedValues = []; - for (const [key, element] of value.entries()) { - clonedKeys.push(createSerializable(key)); - clonedValues.push(createSerializable(element)); - } - const clone = WorkletsModule.createSerializableMap(clonedKeys, clonedValues); - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - freezeObjectInDev(value); - return clone; -} -function cloneSet(value) { - const clonedElements = []; - for (const element of value) { - clonedElements.push(createSerializable(element)); - } - const clone = WorkletsModule.createSerializableSet(clonedElements); - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - freezeObjectInDev(value); - return clone; -} -function cloneRegExp(value) { - const pattern = value.source; - const flags = value.flags; - const handle = cloneInitializer({ - __init: () => { - 'worklet'; - - return new RegExp(pattern, flags); - } - }); - serializableMappingCache.set(value, handle); - return handle; -} -function cloneError(value) { - const { - name, - message, - stack - } = value; - const handle = cloneInitializer({ - __init: () => { - 'worklet'; - - // eslint-disable-next-line reanimated/use-worklets-error - const error = new Error(); - error.name = name; - error.message = message; - error.stack = stack; - return error; - } - }); - serializableMappingCache.set(value, handle); - return handle; -} -function cloneArrayBuffer(value, shouldPersistRemote) { - const clone = WorkletsModule.createSerializable(value, shouldPersistRemote, value); - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - return clone; -} -function cloneArrayBufferView(value) { - const buffer = value.buffer; - const typeName = value.constructor.name; - const handle = cloneInitializer({ - __init: () => { - 'worklet'; - - if (!VALID_ARRAY_VIEWS_NAMES.includes(typeName)) { - throw new WorkletsError(`Invalid array view name \`${typeName}\`.`); - } - const constructor = global[typeName]; - if (constructor === undefined) { - throw new WorkletsError(`Constructor for \`${typeName}\` not found.`); - } - return new constructor(buffer); - } - }); - serializableMappingCache.set(value, handle); - return handle; -} -function cloneSynchronizable(value) { - serializableMappingCache.set(value); - return value; -} -function cloneImport(value) { - const { - source, - imported - } = value.__bundleData; - const clone = WorkletsModule.createSerializableImport(source, imported); - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - return clone; -} -function cloneCustom(data, pack, typeId) { - const packedData = pack(data); - const serialized = createSerializable(packedData); - return WorkletsModule.createCustomSerializable(serialized, typeId); -} -function inaccessibleObject(value) { - // This is reached for object types that are not of plain Object.prototype. - // We don't support such objects from being transferred as serializables to - // the UI runtime and hence we replace them with "inaccessible object" - // which is implemented as a Proxy object that throws on any attempt - // of accessing its fields. We argue that such objects can sometimes leak - // as attributes of objects being captured by worklets but should never - // be used on the UI runtime regardless. If they are being accessed, the user - // will get an appropriate error message. - const clone = createSerializable(INACCESSIBLE_OBJECT); - serializableMappingCache.set(value, clone); - return clone; -} -const WORKLET_CODE_THRESHOLD = 255; -function getWorkletCode(value) { - const code = value?.__initData?.code; - if (!code) { - return 'unknown'; - } - if (code.length > WORKLET_CODE_THRESHOLD) { - return `${code.substring(0, WORKLET_CODE_THRESHOLD)}...`; - } - return code; -} -function isRemoteFunction(value) { - 'worklet'; - - return !!value.__remoteFunction; -} - -/** - * We freeze - * - * - Arrays, - * - Remote functions, - * - Plain JS objects, - * - * That are transformed to a serializable with a meaningful warning. This should - * help detect issues when someone modifies data after it's been converted. - * Meaning that they may be doing a faulty assumption in their code expecting - * that the updates are going to automatically propagate to the object sent to - * the UI thread. If the user really wants some objects to be mutable they - * should use shared values instead. - */ -function freezeObjectInDev(value) { - if (!__DEV__ || globalThis.__RUNTIME_KIND !== RuntimeKind.ReactNative) { - return; - } - Object.entries(value).forEach(([key, element]) => { - const descriptor = Object.getOwnPropertyDescriptor(value, key); - if (!descriptor.configurable) { - return; - } - Object.defineProperty(value, key, { - get() { - return element; - }, - set() { - logger.warn(`Tried to modify key \`${key}\` of an object which has been already passed to a worklet. See - https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#tried-to-modify-key-of-an-object-which-has-been-converted-to-a-serializable - for more details.`); - } - }); - }); - Object.preventExtensions(value); -} -function makeShareableCloneOnUIRecursiveLEGACY(value) { - 'worklet'; - - // eslint-disable-next-line @typescript-eslint/no-shadow - function cloneRecursive(value) { - if (typeof value === 'object' && value !== null || typeof value === 'function') { - if (isHostObject(value)) { - // We call `_createSerializableClone` to wrap the provided HostObject - // inside SerializableJSRef. - return global._createSerializableHostObject(value); - } - if (isRemoteFunction(value)) { - // RemoteFunctions are created by us therefore they are - // a Serializable out of the box and there is no need to - // call `_createSerializableClone`. - return value.__remoteFunction; - } - if (Array.isArray(value)) { - return global._createSerializableArray(value.map(cloneRecursive)); - } - if (value.__synchronizableRef) { - return global._createSerializableSynchronizable(value); - } - if (Object.getPrototypeOf(value) !== Object.prototype) { - const length = globalThis.__customSerializationRegistry.length; - for (let i = 0; i < length; i++) { - const { - determine, - pack - } = globalThis.__customSerializationRegistry[i]; - if (determine(value)) { - const packedData = pack(value); - return globalThis.__workletsModuleProxy?.createCustomSerializable(cloneRecursive(packedData), i); - } - } - } - const toAdapt = {}; - for (const [key, element] of Object.entries(value)) { - toAdapt[key] = cloneRecursive(element); - } - return global._createSerializable(toAdapt, value); - } - if (typeof value === 'string') { - return global._createSerializableString(value); - } - if (typeof value === 'number') { - return global._createSerializableNumber(value); - } - if (typeof value === 'boolean') { - return global._createSerializableBoolean(value); - } - if (typeof value === 'bigint') { - return global._createSerializableBigInt(value); - } - if (value === undefined) { - return global._createSerializableUndefined(); - } - if (value === null) { - return global._createSerializableNull(); - } - return global._createSerializable(value, undefined); - } - return cloneRecursive(value); -} - -/** @deprecated This function is no longer supported. */ -export const makeShareableCloneOnUIRecursive = globalThis._WORKLETS_BUNDLE_MODE ? createSerializable : makeShareableCloneOnUIRecursiveLEGACY; - -/** - * This function creates a value on UI with persistent state - changes to it on - * the UI thread will be seen by all worklets. Use it when you want to create a - * value that is read and written only on the UI thread. - * - * @deprecated This function is no longer supported. - */ -export function makeShareable(value) { - if (serializableMappingCache.get(value)) { - return value; - } - const handle = createSerializable({ - __init: () => { - 'worklet'; - - return value; - } - }); - serializableMappingCache.set(value, handle); - return value; -} -//# sourceMappingURL=serializable.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializable.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializable.native.js.map deleted file mode 100644 index f970b3bd..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializable.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["registerWorkletStackDetails","jsVersion","logger","WorkletsError","getRuntimeKind","RuntimeKind","isWorkletFunction","WorkletsModule","isSynchronizable","serializableMappingCache","serializableMappingFlag","MAGIC_KEY","isHostObject","value","isSerializableRef","__serializableRef","isPlainJSObject","object","Object","getPrototypeOf","prototype","isTurboModuleLike","getFromCache","cached","get","INACCESSIBLE_OBJECT","__init","Proxy","_","prop","String","set","VALID_ARRAY_VIEWS_NAMES","DETECT_CYCLIC_OBJECT_DEPTH_THRESHOLD","processedObjectAtThresholdDepth","createSerializable","shouldPersistRemote","depth","detectCyclicObject","isObject","isFunction","cloneString","cloneNumber","cloneBoolean","cloneBigInt","undefined","cloneUndefined","cloneNull","clonePrimitive","Array","isArray","cloneArray","globalThis","_WORKLETS_BUNDLE_MODE","__bundleData","cloneImport","cloneRemoteFunction","cloneTurboModuleLike","cloneHostObject","cloneInitializer","__workletContextObjectFactory","cloneContextObject","cloneWorklet","cloneSynchronizable","clonePlainJSObject","Set","cloneSet","Map","cloneMap","RegExp","cloneRegExp","Error","cloneError","ArrayBuffer","cloneArrayBuffer","isView","cloneArrayBufferView","i","customSerializationRegistry","length","determine","pack","cloneCustom","inaccessibleObject","imported","source","require","resolveWeak","__customSerializationRegistry","registerCustomSerializable","registrationData","__DEV__","ReactNative","name","unpack","verifyRegistrationData","some","data","console","warn","push","createSerializableString","createSerializableNumber","createSerializableBoolean","createSerializableBigInt","createSerializableUndefined","createSerializableNull","cloneObjectProperties","clonedProps","key","element","entries","__initData","createSerializableInitializer","clonedElements","map","clone","createSerializableArray","freezeObjectInDev","createSerializableFunction","createSerializableHostObject","babelVersion","__pluginVersion","getWorkletCode","__workletHash","__stackDetails","createSerializableWorklet","proto","createSerializableTurboModuleLike","workletContextObjectFactory","handle","createSerializableObject","clonedKeys","clonedValues","createSerializableMap","createSerializableSet","pattern","flags","message","stack","error","buffer","typeName","constructor","includes","global","createSerializableImport","typeId","packedData","serialized","createCustomSerializable","WORKLET_CODE_THRESHOLD","code","substring","isRemoteFunction","__remoteFunction","__RUNTIME_KIND","forEach","descriptor","getOwnPropertyDescriptor","configurable","defineProperty","preventExtensions","makeShareableCloneOnUIRecursiveLEGACY","cloneRecursive","_createSerializableHostObject","_createSerializableArray","__synchronizableRef","_createSerializableSynchronizable","__workletsModuleProxy","toAdapt","_createSerializable","_createSerializableString","_createSerializableNumber","_createSerializableBoolean","_createSerializableBigInt","_createSerializableUndefined","_createSerializableNull","makeShareableCloneOnUIRecursive","makeShareable"],"sourceRoot":"../../../src","sources":["memory/serializable.native.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,2BAA2B,QAAQ,iBAAiB;AAC7D,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,MAAM,QAAQ,iBAAiB;AACxC,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,cAAc,EAAEC,WAAW,QAAQ,gBAAgB;AAE5D,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,cAAc,QAAQ,kCAAkC;AACjE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SACEC,wBAAwB,EACxBC,uBAAuB,QAClB,4BAA4B;AASnC,MAAMC,SAAS,GAAG,sBAAsB;AAExC,SAASC,YAAYA,CAACC,KAA0B,EA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4BAA4B,CAAC,CAAC;IAC9C;IAEA,IAAInK,KAAK,KAAK,IAAI,EAAE;MAClB,OAAOoI,MAAM,CAACgC,uBAAuB,CAAC,CAAC;IACzC;IAEA,OAAOhC,MAAM,CAAC0B,mBAAmB,CAAC9J,KAAK,EAAEgC,SAAS,CAAC;EACrD;EACA,OAAOuH,cAAc,CAACvJ,KAAK,CAAC;AAC9B;;AAEA;AACA,OAAO,MAAMqK,+BAA+B,GAC1C9H,UAAU,CAACC,qBAAqB,GAC5BlB,kBAAkB,GAClBgI,qCAC2C;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASgB,aAAaA,CAAwBtK,KAAa,EAAU;EAC1E,IAAIJ,wBAAwB,CAACe,GAAG,CAACX,KAAK,CAAC,EAAE;IACvC,OAAOA,KAAK;EACd;EACA,MAAMqH,MAAM,GAAG/F,kBAAkB,CAAC;IAChCT,MAAM,EAAEA,CAAA,KAAM;MACZ,SAAS;;MACT,OAAOb,KAAK;IACd;EACF,CAAC,CAAC;EACFJ,wBAAwB,CAACsB,GAAG,CAAClB,KAAK,EAAEqH,MAAM,CAAC;EAC3C,OAAOrH,KAAK;AACd","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializableMappingCache.js b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializableMappingCache.js deleted file mode 100644 index 094a1865..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializableMappingCache.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -export const serializableMappingCache = { - set(_serializable, _serializableRef) { - // NOOP - }, - get(_key) { - return null; - } -}; -//# sourceMappingURL=serializableMappingCache.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializableMappingCache.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializableMappingCache.js.map deleted file mode 100644 index 205e8336..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializableMappingCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["serializableMappingCache","set","_serializable","_serializableRef","get","_key"],"sourceRoot":"../../../src","sources":["memory/serializableMappingCache.ts"],"mappings":"AAAA,YAAY;;AAIZ,OAAO,MAAMA,wBAAwB,GAAG;EACtCC,GAAGA,CAACC,aAAqB,EAAEC,gBAAkC,EAAQ;IACnE;EAAA,CACD;EACDC,GAAGA,CAACC,IAAY,EAAqC;IACnD,OAAO,IAAI;EACb;AACF,CAAC","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializableMappingCache.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializableMappingCache.native.js deleted file mode 100644 index 63a81c12..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializableMappingCache.native.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -/** - * This symbol is used to represent a mapping from the value to itself. - * - * It's used to prevent converting a serializable that's already converted - for - * example a Shared Value that's in worklet's closure. - */ -export const serializableMappingFlag = Symbol('serializable flag'); - -/* -During a fast refresh, React holds the same instance of a Mutable -(that's guaranteed by `useRef`) but `serializableCache` gets regenerated and thus -becoming empty. This happens when editing the file that contains the definition of this cache. - -Because of it, `createSerializable` can't find given mapping -in `serializableCache` for the Mutable and tries to clone it as if it was a regular JS object. -During cloning we use `Object.entries` to iterate over the keys which throws an error on accessing `_value`. -For convenience we moved this cache to a separate file so it doesn't scare us with red squiggles. -*/ - -const cache = new WeakMap(); -export const serializableMappingCache = { - set(serializable, serializableRef) { - cache.set(serializable, serializableRef || serializableMappingFlag); - }, - get: cache.get.bind(cache) -}; -//# sourceMappingURL=serializableMappingCache.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializableMappingCache.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializableMappingCache.native.js.map deleted file mode 100644 index 960ede3c..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/serializableMappingCache.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["serializableMappingFlag","Symbol","cache","WeakMap","serializableMappingCache","set","serializable","serializableRef","get","bind"],"sourceRoot":"../../../src","sources":["memory/serializableMappingCache.native.ts"],"mappings":"AAAA,YAAY;;AAIZ;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,uBAAuB,GAAGC,MAAM,CAAC,mBAAmB,CAAC;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,KAAK,GAAG,IAAIC,OAAO,CAAmC,CAAC;AAE7D,OAAO,MAAMC,wBAAwB,GAAG;EACtCC,GAAGA,CAACC,YAAoB,EAAEC,eAAiC,EAAQ;IACjEL,KAAK,CAACG,GAAG,CAACC,YAAY,EAAEC,eAAe,IAAIP,uBAAuB,CAAC;EACrE,CAAC;EACDQ,GAAG,EAAEN,KAAK,CAACM,GAAG,CAACC,IAAI,CAACP,KAAK;AAC3B,CAAC","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizable.js b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizable.js deleted file mode 100644 index b35b7948..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizable.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -import { WorkletsError } from '../debug/WorkletsError'; -export function createSynchronizable(_value) { - throw new WorkletsError('`createSynchronizable` is not supported on web.'); -} -//# sourceMappingURL=synchronizable.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizable.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizable.js.map deleted file mode 100644 index fefcd549..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["WorkletsError","createSynchronizable","_value"],"sourceRoot":"../../../src","sources":["memory/synchronizable.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,aAAa,QAAQ,wBAAwB;AAGtD,OAAO,SAASC,oBAAoBA,CAClCC,MAAc,EACU;EACxB,MAAM,IAAIF,aAAa,CAAC,iDAAiD,CAAC;AAC5E","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizable.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizable.native.js deleted file mode 100644 index f9b4c9f6..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizable.native.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -import { WorkletsModule } from '../WorkletsModule/NativeWorklets'; -import { createSerializable } from './serializable'; -export function createSynchronizable(initialValue) { - const synchronizableRef = WorkletsModule.createSynchronizable(createSerializable(initialValue)); - return globalThis.__synchronizableUnpacker(synchronizableRef); -} -//# sourceMappingURL=synchronizable.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizable.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizable.native.js.map deleted file mode 100644 index ea733126..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizable.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["WorkletsModule","createSerializable","createSynchronizable","initialValue","synchronizableRef","globalThis","__synchronizableUnpacker"],"sourceRoot":"../../../src","sources":["memory/synchronizable.native.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,cAAc,QAAQ,kCAAkC;AACjE,SAASC,kBAAkB,QAAQ,gBAAgB;AAGnD,OAAO,SAASC,oBAAoBA,CAClCC,YAAoB,EACI;EACxB,MAAMC,iBAAiB,GAAGJ,cAAc,CAACE,oBAAoB,CAC3DD,kBAAkB,CAACE,YAAY,CACjC,CAAC;EAED,OAAOE,UAAU,CAACC,wBAAwB,CACxCF,iBACF,CAAC;AACH","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizableUnpacker.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizableUnpacker.native.js deleted file mode 100644 index b68b867d..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizableUnpacker.native.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; - -import { createSerializable } from './serializable'; -export function __installUnpacker() { - // TODO: Add cache for synchronizables. - const serializer = !globalThis._WORKLET || globalThis._WORKLETS_BUNDLE_MODE ? (value, _) => createSerializable(value) : globalThis._createSerializable; - function synchronizableUnpacker(synchronizableRef) { - const synchronizable = synchronizableRef; - const proxy = globalThis.__workletsModuleProxy; - synchronizable.__synchronizableRef = true; - synchronizable.getDirty = () => { - return proxy.synchronizableGetDirty(synchronizable); - }; - synchronizable.getBlocking = () => { - return proxy.synchronizableGetBlocking(synchronizable); - }; - synchronizable.setBlocking = valueOrFunction => { - let newValue; - if (typeof valueOrFunction === 'function') { - const func = valueOrFunction; - synchronizable.lock(); - const prev = synchronizable.getBlocking(); - newValue = func(prev); - proxy.synchronizableSetBlocking(synchronizable, serializer(newValue, undefined)); - synchronizable.unlock(); - } else { - const value = valueOrFunction; - newValue = value; - proxy.synchronizableSetBlocking(synchronizable, serializer(newValue, undefined)); - } - }; - synchronizable.lock = () => { - proxy.synchronizableLock(synchronizable); - }; - synchronizable.unlock = () => { - proxy.synchronizableUnlock(synchronizable); - }; - return synchronizable; - } - globalThis.__synchronizableUnpacker = synchronizableUnpacker; -} -//# sourceMappingURL=synchronizableUnpacker.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizableUnpacker.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizableUnpacker.native.js.map deleted file mode 100644 index 1ed5eb9f..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/synchronizableUnpacker.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["createSerializable","__installUnpacker","serializer","globalThis","_WORKLET","_WORKLETS_BUNDLE_MODE","value","_","_createSerializable","synchronizableUnpacker","synchronizableRef","synchronizable","proxy","__workletsModuleProxy","__synchronizableRef","getDirty","synchronizableGetDirty","getBlocking","synchronizableGetBlocking","setBlocking","valueOrFunction","newValue","func","lock","prev","synchronizableSetBlocking","undefined","unlock","synchronizableLock","synchronizableUnlock","__synchronizableUnpacker"],"sourceRoot":"../../../src","sources":["memory/synchronizableUnpacker.native.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,kBAAkB,QAAQ,gBAAgB;AAGnD,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EAClC;EACA,MAAMC,UAAU,GACd,CAACC,UAAU,CAACC,QAAQ,IAAID,UAAU,CAACE,qBAAqB,GACpD,CAACC,KAAc,EAAEC,CAAU,KAAKP,kBAAkB,CAACM,KAAK,CAAC,GACzDH,UAAU,CAACK,mBAAmB;EAEpC,SAASC,sBAAsBA,CAC7BC,iBAA4C,EACpB;IACxB,MAAMC,cAAc,GAClBD,iBAAsD;IACxD,MAAME,KAAK,GAAGT,UAAU,CAACU,qBAAsB;IAE/CF,cAAc,CAACG,mBAAmB,GAAG,IAAI;IACzCH,cAAc,CAACI,QAAQ,GAAG,MAAM;MAC9B,OAAOH,KAAK,CAACI,sBAAsB,CAACL,cAAc,CAAC;IACrD,CAAC;IACDA,cAAc,CAACM,WAAW,GAAG,MAAM;MACjC,OAAOL,KAAK,CAACM,yBAAyB,CAACP,cAAc,CAAC;IACxD,CAAC;IACDA,cAAc,CAACQ,WAAW,GACxBC,eAAoD,IACjD;MACH,IAAIC,QAAgB;MACpB,IAAI,OAAOD,eAAe,KAAK,UAAU,EAAE;QACzC,MAAME,IAAI,GAAGF,eAA2C;QACxDT,cAAc,CAACY,IAAI,CAAC,CAAC;QACrB,MAAMC,IAAI,GAAGb,cAAc,CAACM,WAAW,CAAC,CAAC;QACzCI,QAAQ,GAAGC,IAAI,CAACE,IAAI,CAAC;QAErBZ,KAAK,CAACa,yBAAyB,CAC7Bd,cAAc,EACdT,UAAU,CAACmB,QAAQ,EAAEK,SAAS,CAChC,CAAC;QAEDf,cAAc,CAACgB,MAAM,CAAC,CAAC;MACzB,CAAC,MAAM;QACL,MAAMrB,KAAK,GAAGc,eAAe;QAC7BC,QAAQ,GAAGf,KAAK;QAChBM,KAAK,CAACa,yBAAyB,CAC7Bd,cAAc,EACdT,UAAU,CAACmB,QAAQ,EAAEK,SAAS,CAChC,CAAC;MACH;IACF,CAAC;IACDf,cAAc,CAACY,IAAI,GAAG,MAAM;MAC1BX,KAAK,CAACgB,kBAAkB,CAACjB,cAAc,CAAC;IAC1C,CAAC;IACDA,cAAc,CAACgB,MAAM,GAAG,MAAM;MAC5Bf,KAAK,CAACiB,oBAAoB,CAAClB,cAAc,CAAC;IAC5C,CAAC;IAED,OAAOA,cAAc;EACvB;EAEAR,UAAU,CAAC2B,wBAAwB,GAAGrB,sBAAsB;AAC9D","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/types.js b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/types.js deleted file mode 100644 index 374e89e6..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/types.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -/** - * The below type is used for HostObjects returned by the JSI API that don't - * have any accessible fields or methods but can carry data that is accessed - * from the c++ side. We add a field to the type to make it possible for - * typescript to recognize which JSI methods accept those types as arguments and - * to be able to correctly type check other methods that may use them. However, - * this field is not actually defined nor should be used for anything else as - * assigning any data to those objects will throw an error. - */ -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/types.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/types.js.map deleted file mode 100644 index 9d7a9f9d..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":[],"sourceRoot":"../../../src","sources":["memory/types.ts"],"mappings":"AAAA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/valueUnpacker.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/valueUnpacker.native.js deleted file mode 100644 index dc737a70..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/valueUnpacker.native.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -function __installUnpacker() { - const workletsCache = new Map(); - const handleCache = new WeakMap(); - function valueUnpacker(objectToUnpack, category, remoteFunctionName) { - // eslint-disable-next-line strict - 'use strict'; - - const workletHash = objectToUnpack.__workletHash; - if (workletHash !== undefined) { - let workletFun = workletsCache.get(workletHash); - if (workletFun === undefined) { - const initData = objectToUnpack.__initData; - if (globalThis.evalWithSourceMap) { - // if the runtime (hermes only for now) supports loading source maps - // we want to use the proper filename for the location as it guarantees - // that debugger understands and loads the source code of the file where - // the worklet is defined. - workletFun = globalThis.evalWithSourceMap('(' + initData.code + '\n)', initData.location, initData.sourceMap); - } else if (globalThis.evalWithSourceUrl) { - // if the runtime doesn't support loading source maps, in dev mode we - // can pass source url when evaluating the worklet. Now, instead of using - // the actual file location we use worklet hash, as it the allows us to - // properly symbolicate traces (see errors.ts for details) - workletFun = globalThis.evalWithSourceUrl('(' + initData.code + '\n)', `worklet_${workletHash}`); - } else { - // in release we use the regular eval to save on JSI calls - // eslint-disable-next-line no-eval - workletFun = eval('(' + initData.code + '\n)'); - } - workletsCache.set(workletHash, workletFun); - } - const functionInstance = workletFun.bind(objectToUnpack); - objectToUnpack._recur = functionInstance; - return functionInstance; - } else if (objectToUnpack.__init !== undefined) { - let value = handleCache.get(objectToUnpack); - if (value === undefined) { - value = objectToUnpack.__init(); - handleCache.set(objectToUnpack, value); - } - return value; - } else if (category === 'RemoteFunction') { - const fun = () => { - const label = remoteFunctionName ? `function \`${remoteFunctionName}\`` : 'anonymous function'; - // eslint-disable-next-line reanimated/use-worklets-error - throw new Error(`[Worklets] Tried to synchronously call a non-worklet ${label} on the UI thread. -See https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#tried-to-synchronously-call-a-non-worklet-function-on-the-ui-thread for more details.`); - }; - fun.__remoteFunction = objectToUnpack; - return fun; - } else { - // eslint-disable-next-line reanimated/use-worklets-error - throw new Error(`[Worklets] Data type in category "${category}" not recognized by value unpacker: "${globalThis._toString(objectToUnpack)}".`); - } - } - globalThis.__valueUnpacker = valueUnpacker; -} -export {}; -//# sourceMappingURL=valueUnpacker.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/valueUnpacker.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/memory/valueUnpacker.native.js.map deleted file mode 100644 index 7a781f91..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/memory/valueUnpacker.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["__installUnpacker","workletsCache","Map","handleCache","WeakMap","valueUnpacker","objectToUnpack","category","remoteFunctionName","workletHash","__workletHash","undefined","workletFun","get","initData","__initData","globalThis","evalWithSourceMap","code","location","sourceMap","evalWithSourceUrl","eval","set","functionInstance","bind","_recur","__init","value","fun","label","Error","__remoteFunction","_toString","__valueUnpacker"],"sourceRoot":"../../../src","sources":["memory/valueUnpacker.native.ts"],"mappings":"AAAA,YAAY;;AAaZ,SAASA,iBAAiBA,CAAA,EAAG;EAC3B,MAAMC,aAAa,GAAG,IAAIC,GAAG,CAAwB,CAAC;EACtD,MAAMC,WAAW,GAAG,IAAIC,OAAO,CAAkB,CAAC;EAElD,SAASC,aAAaA,CACpBC,cAA8B,EAC9BC,QAAiB,EACjBC,kBAA2B,EAClB;IACT;IACA,YAAY;;IACZ,MAAMC,WAAW,GAAGH,cAAc,CAACI,aAAa;IAChD,IAAID,WAAW,KAAKE,SAAS,EAAE;MAC7B,IAAIC,UAAU,GAAGX,aAAa,CAACY,GAAG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A,KAAM;QAChB,MAAMC,KAAK,GAAGtB,kBAAkB,GAC5B,cAAcA,kBAAkB,IAAI,GACpC,oBAAoB;QACxB;QACA,MAAM,IAAIuB,KAAK,CAAC,wDAAwDD,KAAK;AACrF,uKAAuK,CAAC;MAClK,CAAC;MACDD,GAAG,CAACG,gBAAgB,GAAG1B,cAAc;MACrC,OAAOuB,GAAG;IACZ,CAAC,MAAM;MACL;MACA,MAAM,IAAIE,KAAK,CACb,qCAAqCxB,QAAQ,wCAAwCS,UAAU,CAACiB,SAAS,CACvG3B,cACF,CAAC,IACH,CAAC;IACH;EACF;EAEAU,UAAU,CAACkB,eAAe,GAAG7B,aAA8B;AAC7D;AAAC","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/mock.js b/frontend-admin/node_modules/react-native-worklets/lib/module/mock.js deleted file mode 100644 index 58f9c3d9..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/mock.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -import { mockedRequestAnimationFrame } from './runLoop/uiRuntime/mockedRequestAnimationFrame'; -import { RuntimeKind } from './runtimeKind'; -import { isWorkletFunction } from './workletFunction'; -const NOOP = () => {}; -const NOOP_FACTORY = () => NOOP; -const ID = value => value; -const IMMEDIATE_CALLBACK_INVOCATION = callback => callback(); -globalThis._WORKLET = false; -globalThis.__RUNTIME_KIND = RuntimeKind.ReactNative; -globalThis._log = console.log; -globalThis._getAnimationTimestamp = () => performance.now(); -// requestAnimationFrame react-native jest's setup is incorrect as it polyfills -// the method directly using setTimeout, therefore the callback doesn't get the -// expected timestamp as the only argument: https://github.com/facebook/react-native/blob/main/packages/react-native/jest/setup.js#L28 -// We override this setup here to make sure that callbacks get the proper timestamps -// when executed. For non-jest environments we define requestAnimationFrame in setupRequestAnimationFrame -// @ts-ignore TypeScript uses Node definition for rAF, setTimeout, etc which returns a Timeout object rather than a number -globalThis.requestAnimationFrame = mockedRequestAnimationFrame; -const WorkletAPI = { - isShareableRef: () => true, - makeShareable: ID, - makeShareableCloneOnUIRecursive: ID, - makeShareableCloneRecursive: ID, - shareableMappingCache: new Map(), - getStaticFeatureFlag: () => false, - setDynamicFeatureFlag: NOOP, - isSynchronizable: () => false, - getRuntimeKind: () => RuntimeKind.ReactNative, - RuntimeKind: RuntimeKind, - createWorkletRuntime: NOOP_FACTORY, - runOnRuntime: ID, - scheduleOnRuntime: IMMEDIATE_CALLBACK_INVOCATION, - createSerializable: ID, - isSerializableRef: ID, - serializableMappingCache: new Map(), - createSynchronizable: ID, - callMicrotasks: NOOP, - executeOnUIRuntimeSync: ID, - runOnJS(fun) { - return (...args) => queueMicrotask(args.length ? () => fun(...args) : fun); - }, - runOnUI(worklet) { - return (...args) => { - // Mocking time in Jest is tricky as both requestAnimationFrame and queueMicrotask - // callbacks run on the same queue and can be interleaved. There is no way - // to flush particular queue in Jest and the only control over mocked timers - // is by using jest.advanceTimersByTime() method which advances all types - // of timers including immediate and animation callbacks. Ideally we'd like - // to have some way here to schedule work along with React updates, but - // that's not possible, and hence in Jest environment instead of using scheduling - // mechanism we just schedule the work ommiting the queue. This is ok for the - // uses that we currently have but may not be ok for future tests that we write. - mockedRequestAnimationFrame(() => { - worklet(...args); - }); - }; - }, - runOnUIAsync(worklet) { - return (...args) => { - return new Promise(resolve => { - mockedRequestAnimationFrame(() => { - const result = worklet(...args); - resolve(result); - }); - }); - }; - }, - runOnUISync: IMMEDIATE_CALLBACK_INVOCATION, - scheduleOnRN(fun, ...args) { - WorkletAPI.runOnJS(fun)(...args); - }, - scheduleOnUI(worklet, ...args) { - WorkletAPI.runOnUI(worklet)(...args); - }, - // eslint-disable-next-line camelcase - unstable_eventLoopTask: NOOP_FACTORY, - isWorkletFunction: isWorkletFunction, - WorkletsModule: {} -}; -module.exports = { - __esModule: true, - ...WorkletAPI -}; -//# sourceMappingURL=mock.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/mock.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/mock.js.map deleted file mode 100644 index 4385977a..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/mock.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["mockedRequestAnimationFrame","RuntimeKind","isWorkletFunction","NOOP","NOOP_FACTORY","ID","value","IMMEDIATE_CALLBACK_INVOCATION","callback","globalThis","_WORKLET","__RUNTIME_KIND","ReactNative","_log","console","log","_getAnimationTimestamp","performance","now","requestAnimationFrame","WorkletAPI","isShareableRef","makeShareable","makeShareableCloneOnUIRecursive","makeShareableCloneRecursive","shareableMappingCache","Map","getStaticFeatureFlag","setDynamicFeatureFlag","isSynchronizable","getRuntimeKind","createWorkletRuntime","runOnRuntime","scheduleOnRuntime","createSerializable","isSerializableRef","serializableMappingCache","createSynchronizable","callMicrotasks","executeOnUIRuntimeSync","runOnJS","fun","args","queueMicrotask","length","runOnUI","worklet","runOnUIAsync","Promise","resolve","result","runOnUISync","scheduleOnRN","scheduleOnUI","unstable_eventLoopTask","WorkletsModule","module","exports","__esModule"],"sourceRoot":"../../src","sources":["mock.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,2BAA2B,QAAQ,iDAAiD;AAC7F,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,iBAAiB,QAAQ,mBAAmB;AAErD,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,MAAMC,YAAY,GAAGA,CAAA,KAAMD,IAAI;AAC/B,MAAME,EAAE,GAAYC,KAAa,IAAKA,KAAK;AAC3C,MAAMC,6BAA6B,GAAeC,QAAyB,IACzEA,QAAQ,CAAC,CAAC;AAEZC,UAAU,CAACC,QAAQ,GAAG,KAAK;AAC3BD,UAAU,CAACE,cAAc,GAAGV,WAAW,CAACW,WAAW;AACnDH,UAAU,CAACI,IAAI,GAAGC,OAAO,CAACC,GAAG;AAC7BN,UAAU,CAACO,sBAAsB,GAAG,MAAMC,WAAW,CAACC,GAAG,CAAC,CAAC;AAC3D;AAC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xB,OAAO,IAAIM,OAAO,CAAeC,OAAO,IAAK;QAC3CjD,2BAA2B,CAAC,MAAM;UAChC,MAAMkD,MAAM,GAAGJ,OAAO,CAAC,GAAGJ,IAAI,CAAC;UAC/BO,OAAO,CAACC,MAAM,CAAC;QACjB,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ,CAAC;EACH,CAAC;EACDC,WAAW,EAAE5C,6BAA6B;EAC1C6C,YAAYA,CACVX,GAAmC,EACnC,GAAGC,IAAU,EACP;IACNtB,UAAU,CAACoB,OAAO,CAACC,GAAG,CAAC,CAAC,GAAGC,IAAI,CAAC;EAClC,CAAC;EACDW,YAAYA,CACVP,OAAuC,EACvC,GAAGJ,IAAU,EACP;IACNtB,UAAU,CAACyB,OAAO,CAACC,OAAO,CAAC,CAAC,GAAGJ,IAAI,CAAC;EACtC,CAAC;EACD;EACAY,sBAAsB,EAAElD,YAAY;EACpCF,iBAAiB,EAAEA,iBAAiB;EACpCqD,cAAc,EAAE,CAAC;AACnB,CAAC;AAEDC,MAAM,CAACC,OAAO,GAAG;EACfC,UAAU,EAAE,IAAI;EAChB,GAAGtC;AACL,CAAC","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/platformChecker.js b/frontend-admin/node_modules/react-native-worklets/lib/module/platformChecker.js deleted file mode 100644 index 386603c8..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/platformChecker.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -import { Platform } from 'react-native'; -export const IS_JEST = !!process.env.JEST_WORKER_ID; -export const IS_WEB = Platform.OS === 'web'; -export const IS_WINDOWS = Platform.OS === 'windows'; -export const SHOULD_BE_USE_WEB = IS_JEST || IS_WEB || IS_WINDOWS; -//# sourceMappingURL=platformChecker.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/platformChecker.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/platformChecker.js.map deleted file mode 100644 index aeb3c570..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/platformChecker.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["Platform","IS_JEST","process","env","JEST_WORKER_ID","IS_WEB","OS","IS_WINDOWS","SHOULD_BE_USE_WEB"],"sourceRoot":"../../src","sources":["platformChecker.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAO,MAAMC,OAAgB,GAAG,CAAC,CAACC,OAAO,CAACC,GAAG,CAACC,cAAc;AAC5D,OAAO,MAAMC,MAAe,GAAGL,QAAQ,CAACM,EAAE,KAAK,KAAK;AACpD,OAAO,MAAMC,UAAmB,GAAGP,QAAQ,CAACM,EAAE,KAAK,SAAS;AAC5D,OAAO,MAAME,iBAA0B,GAAGP,OAAO,IAAII,MAAM,IAAIE,UAAU","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/platformChecker.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/platformChecker.native.js deleted file mode 100644 index cac1d0ad..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/platformChecker.native.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -export const IS_JEST = false; -//# sourceMappingURL=platformChecker.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/platformChecker.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/platformChecker.native.js.map deleted file mode 100644 index 829d5ca1..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/platformChecker.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["IS_JEST"],"sourceRoot":"../../src","sources":["platformChecker.native.ts"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,MAAMA,OAAO,GAAG,KAAK","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/privateGlobals.d.js b/frontend-admin/node_modules/react-native-worklets/lib/module/privateGlobals.d.js index 8f6b36b2..7819c31c 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/privateGlobals.d.js +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/privateGlobals.d.js @@ -1,3 +1,4 @@ +/* eslint-disable reanimated/use-global-this */ 'use strict'; // This file works by accident - currently Builder Bob doesn't move `.d.ts` files to output types. diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/privateGlobals.d.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/privateGlobals.d.js.map index 4c5f1022..b8d3af17 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/privateGlobals.d.js.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/privateGlobals.d.js.map @@ -1 +1 @@ -{"version":3,"names":[],"sourceRoot":"../../src","sources":["privateGlobals.d.ts"],"mappings":"AAAA,YAAY;;AAEZ;AACA;AAAA","ignoreList":[]} +{"version":3,"names":[],"sourceRoot":"../../src","sources":["privateGlobals.d.ts"],"mappings":"AAAA;AACA,YAAY;;AAEZ;AACA;AAAA","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/uiRuntime/requestAnimationFrame.js b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/uiRuntime/requestAnimationFrame.js index aa82693e..8cd6d712 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/uiRuntime/requestAnimationFrame.js +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/uiRuntime/requestAnimationFrame.js @@ -1,6 +1,6 @@ 'use strict'; -import { callMicrotasks } from '../../threads'; +import { callMicrotasks } from "../../threads.js"; export function setupRequestAnimationFrame() { 'worklet'; diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/uiRuntime/requestAnimationFrame.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/uiRuntime/requestAnimationFrame.js.map index 475f2ef7..877315c6 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/uiRuntime/requestAnimationFrame.js.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/uiRuntime/requestAnimationFrame.js.map @@ -1 +1 @@ -{"version":3,"names":["callMicrotasks","setupRequestAnimationFrame","nativeRequestAnimationFrame","globalThis","requestAnimationFrame","queuedCallbacks","queuedCallbacksBegin","queuedCallbacksEnd","flushedCallbacks","flushedCallbacksBegin","flushedCallbacksEnd","flushRequested","__flushAnimationFrame","timestamp","callback","handle","push","__frameTimestamp","undefined","cancelAnimationFrame"],"sourceRoot":"../../../../src","sources":["runLoop/uiRuntime/requestAnimationFrame.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,cAAc,QAAQ,eAAe;AAE9C,OAAO,SAASC,0BAA0BA,CAAA,EAAG;EAC3C,SAAS;;EACT,MAAMC,2BAA2B,GAAGC,UAAU,CAACC,qBAAqB;EAEpE,IAAIC,eAAgD,GAAG,EAAE;EACzD,IAAIC,oBAAoB,GAAG,CAAC;EAC5B,IAAIC,kBAAkB,GAAG,CAAC;EAE1B,IAAIC,gBAAgB,GAAGH,eAAe;EACtC,IAAII,qBAAqB,GAAG,CAAC;EAC7B,IAAIC,mBAAmB,GAAG,CAAC;EAE3B,IAAIC,cAAc,GAAG,KAAK;EAE1BR,UAAU,CAACS,qBAAqB,GAAIC,SAAiB,IAAK;IACxDL,gBAAgB,GAAGH,eAAe;IAClCA,eAAe,GAAG,EAAE;IAEpBI,qBAAqB,GAAGH,oBAAoB;IAC5CI,mBAAmB,GAAGH,kBAAkB;IACxCD,oBAAoB,GAAGC,kBAAkB;IAEzC,KAAK,MAAMO,QAAQ,IAAIN,gBAAgB,EAAE;MACvCM,QAAQ,CAACD,SAAS,CAAC;IACrB;IAEAJ,qBAAqB,GAAGC,mBAAmB;IAE3CV,cAAc,CAAC,CAAC;EAClB,CAAC;EAEDG,UAAU,CAACC,qBAAqB,GAC9BU,QAAqC,IAC1B;IACX,MAAMC,MAAM,GAAGR,kBAAkB,EAAE;IAEnCF,eAAe,CAACW,IAAI,CAACF,QAAQ,CAAC;IAC9B,IAAI,CAACH,cAAc,EAAE;MACnBA,cAAc,GAAG,IAAI;MAErBT,2BAA2B,CAAEW,SAAS,IAAK;QACzCF,cAAc,GAAG,KAAK;QACtBR,UAAU,CAACc,gBAAgB,GAAGJ,SAAS;QACvCV,UAAU,CAACS,qBAAqB,CAACC,SAAS,CAAC;QAC3CV,UAAU,CAACc,gBAAgB,GAAGC,SAAS;MACzC,CAAC,CAAC;IACJ;IACA,OAAOH,MAAM;EACf,CAAC;EAEDZ,UAAU,CAACgB,oBAAoB,GAAIJ,MAAc,IAAK;IACpD,IAAIA,MAAM,GAAGN,qBAAqB,IAAIM,MAAM,IAAIR,kBAAkB,EAAE;MAClE;IACF;IAEA,IAAIQ,MAAM,GAAGL,mBAAmB,EAAE;MAChCF,gBAAgB,CAACO,MAAM,GAAGN,qBAAqB,CAAC,GAAG,MAAM,CAAC,CAAC;IAC7D,CAAC,MAAM;MACLJ,eAAe,CAACU,MAAM,GAAGT,oBAAoB,CAAC,GAAG,MAAM,CAAC,CAAC;IAC3D;EACF,CAAC;AACH","ignoreList":[]} +{"version":3,"names":["callMicrotasks","setupRequestAnimationFrame","nativeRequestAnimationFrame","globalThis","requestAnimationFrame","queuedCallbacks","queuedCallbacksBegin","queuedCallbacksEnd","flushedCallbacks","flushedCallbacksBegin","flushedCallbacksEnd","flushRequested","__flushAnimationFrame","timestamp","callback","handle","push","__frameTimestamp","undefined","cancelAnimationFrame"],"sourceRoot":"../../../../src","sources":["runLoop/uiRuntime/requestAnimationFrame.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,cAAc,QAAQ,kBAAe;AAE9C,OAAO,SAASC,0BAA0BA,CAAA,EAAG;EAC3C,SAAS;;EACT,MAAMC,2BAA2B,GAAGC,UAAU,CAACC,qBAAqB;EAEpE,IAAIC,eAAgD,GAAG,EAAE;EACzD,IAAIC,oBAAoB,GAAG,CAAC;EAC5B,IAAIC,kBAAkB,GAAG,CAAC;EAE1B,IAAIC,gBAAgB,GAAGH,eAAe;E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C3D;EACF,CAAC;AACH","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/index.js b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/index.js index 6428120f..f0533406 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/index.js +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/index.js @@ -1,11 +1,11 @@ 'use strict'; -import { setupSetImmediate } from '../common/setImmediatePolyfill'; -import { setupSetInterval } from '../common/setIntervalPolyfill'; -import { setupQueueMicrotask } from './queueMicrotask'; -import { setupRequestAnimationFrame } from './requestAnimationFramePolyfill'; -import { setupSetTimeout } from './setTimeout'; -import { setupTaskQueue } from './taskQueue'; +import { setupSetImmediate } from "../common/setImmediatePolyfill.js"; +import { setupSetInterval } from "../common/setIntervalPolyfill.js"; +import { setupQueueMicrotask } from "./queueMicrotask.js"; +import { setupRequestAnimationFrame } from "./requestAnimationFramePolyfill.js"; +import { setupSetTimeout } from "./setTimeout.js"; +import { setupTaskQueue } from "./taskQueue.js"; export function setupRunLoop(animationQueuePollingRate) { 'worklet'; diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/index.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/index.js.map index aeb90bf1..afa2569a 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/index.js.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/index.js.map @@ -1 +1 @@ -{"version":3,"names":["setupSetImmediate","setupSetInterval","setupQueueMicrotask","setupRequestAnimationFrame","setupSetTimeout","setupTaskQueue","setupRunLoop","animationQueuePollingRate"],"sourceRoot":"../../../../src","sources":["runLoop/workletRuntime/index.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,iBAAiB,QAAQ,gCAAgC;AAClE,SAASC,gBAAgB,QAAQ,+BAA+B;AAChE,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,0BAA0B,QAAQ,iCAAiC;AAC5E,SAASC,eAAe,QAAQ,cAAc;AAC9C,SAASC,cAAc,QAAQ,aAAa;AAE5C,OAAO,SAASC,YAAYA,CAACC,yBAAiC,EAAE;EAC9D,SAAS;;EACTF,cAAc,CAAC,CAAC;EAChBH,mBAAmB,CAAC,CAAC;EACrBE,eAAe,CAAC,CAAC;EACjBD,0BAA0B,CAACI,yBAAyB,CAAC;EACrDP,iBAAiB,CAAC,CAAC;EACnBC,gBAAgB,CAAC,CAAC;AACpB","ignoreList":[]} +{"version":3,"names":["setupSetImmediate","setupSetInterval","setupQueueMicrotask","setupRequestAnimationFrame","setupSetTimeout","setupTaskQueue","setupRunLoop","animationQueuePollingRate"],"sourceRoot":"../../../../src","sources":["runLoop/workletRuntime/index.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,iBAAiB,QAAQ,mCAAgC;AAClE,SAASC,gBAAgB,QAAQ,kCAA+B;AAChE,SAASC,mBAAmB,QAAQ,qBAAkB;AACtD,SAASC,0BAA0B,QAAQ,oCAAiC;AAC5E,SAASC,eAAe,QAAQ,iBAAc;AAC9C,SAASC,cAAc,QAAQ,gBAAa;AAE5C,OAAO,SAASC,YAAYA,CAACC,yBAAiC,EAAE;EAC9D,SAAS;;EACTF,cAAc,CAAC,CAAC;EAChBH,mBAAmB,CAAC,CAAC;EACrBE,eAAe,CAAC,CAAC;EACjBD,0BAA0B,CAACI,yBAAyB,CAAC;EACrDP,iBAAiB,CAAC,CAAC;EACnBC,gBAAgB,CAAC,CAAC;AACpB","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/queueMicrotask.js b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/queueMicrotask.js index f258522f..58533218 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/queueMicrotask.js +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/queueMicrotask.js @@ -1,6 +1,6 @@ 'use strict'; -import { pushMicrotask } from './taskQueue'; +import { pushMicrotask } from "./taskQueue.js"; export function setupQueueMicrotask() { 'worklet'; diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/queueMicrotask.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/queueMicrotask.js.map index 33a941a5..cd271d0a 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/queueMicrotask.js.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/queueMicrotask.js.map @@ -1 +1 @@ -{"version":3,"names":["pushMicrotask","setupQueueMicrotask","globalThis","queueMicrotask","callback","args"],"sourceRoot":"../../../../src","sources":["runLoop/workletRuntime/queueMicrotask.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,aAAa,QAAQ,aAAa;AAE3C,OAAO,SAASC,mBAAmBA,CAAA,EAAG;EACpC,SAAS;;EACTC,UAAU,CAACC,cAAc,GAAG,UAC1BC,QAAsC,EACtC,GAAGC,IAAe,EAClB;IACAL,aAAa,CAAC,MAAMI,QAAQ,CAAC,GAAGC,IAAI,CAAC,CAAC;EACxC,CAA0B;AAC5B","ignoreList":[]} +{"version":3,"names":["pushMicrotask","setupQueueMicrotask","globalThis","queueMicrotask","callback","args"],"sourceRoot":"../../../../src","sources":["runLoop/workletRuntime/queueMicrotask.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,aAAa,QAAQ,gBAAa;AAE3C,OAAO,SAASC,mBAAmBA,CAAA,EAAG;EACpC,SAAS;;EACTC,UAAU,CAACC,cAAc,GAAG,UAC1BC,QAAsC,EACtC,GAAGC,IAAe,EAClB;IACAL,aAAa,CAAC,MAAMI,QAAQ,CAAC,GAAGC,IAAI,CAAC,CAAC;EACxC,CAA0B;AAC5B","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/setTimeout.js b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/setTimeout.js index 7ce3196f..9ae8d518 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/setTimeout.js +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/setTimeout.js @@ -1,6 +1,6 @@ 'use strict'; -import { pushTask } from './taskQueue'; +import { pushTask } from "./taskQueue.js"; export function setupSetTimeout() { 'worklet'; diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/setTimeout.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/setTimeout.js.map index cfb582e2..71e02b0b 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/setTimeout.js.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/runLoop/workletRuntime/setTimeout.js.map @@ -1 +1 @@ -{"version":3,"names":["pushTask","setupSetTimeout","pendingHandlers","Set","ID","setTimeoutPolyfill","callback","delay","args","handlerId","timeoutCallback","has","delete","add","clearTimeoutPolyfill","timeoutHandle","globalThis","setTimeout","clearTimeout"],"sourceRoot":"../../../../src","sources":["runLoop/workletRuntime/setTimeout.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,QAAQ,QAAQ,aAAa;AAEtC,OAAO,SAASC,eAAeA,CAAA,EAAG;EAChC,SAAS;;EAET,MAAMC,eAA4B,GAAG,IAAIC,GAAG,CAAC,CAAC;EAC9C,IAAIC,EAAE,GAAG,CAAC;EAEV,MAAMC,kBAAkB,GAAGA,CACzBC,QAAsC,EACtCC,KAAa,GAAG,CAAC,EACjB,GAAGC,IAAe,KACf;IACH,MAAMC,SAAS,GAAGL,EAAE,EAAE;IAEtB,MAAMM,eAAe,GAAGA,CAAA,KAAM;MAC5B,IAAI,CAACR,eAAe,CAACS,GAAG,CAACF,SAAS,CAAC,EAAE;QACnC;MACF;MACAH,QAAQ,CAAC,GAAGE,IAAI,CAAC;MACjBN,eAAe,CAACU,MAAM,CAACH,SAAS,CAAC;IACnC,CAAC;IAEDP,eAAe,CAACW,GAAG,CAACJ,SAAS,CAAC;IAC9BT,QAAQ,CAACU,eAAe,EAAED,SAAS,EAAEF,KAAK,CAAC;IAC3C,OAAOE,SAAS;EAClB,CAAC;EAED,MAAMK,oBAAoB,GAAIC,aAAqB,IAAK;IACtDb,eAAe,CAACU,MAAM,CAACG,aAAa,CAAC;EACvC,CAAC;EAEDC,UAAU,CAACC,UAAU,GAAGZ,kBAAuC;EAC/DW,UAAU,CAACE,YAAY,GAAGJ,oBAA2C;AACvE","ignoreList":[]} +{"version":3,"names":["pushTask","setupSetTimeout","pendingHandlers","Set","ID","setTimeoutPolyfill","callback","delay","args","handlerId","timeoutCallback","has","delete","add","clearTimeoutPolyfill","timeoutHandle","globalThis","setTimeout","clearTimeout"],"sourceRoot":"../../../../src","sources":["runLoop/workletRuntime/setTimeout.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,QAAQ,QAAQ,gBAAa;AAEtC,OAAO,SAASC,eAAeA,CAAA,EAAG;EAChC,SAAS;;EAET,MAAMC,eAA4B,GAAG,IAAIC,GAAG,CAAC,CAAC;EAC9C,IAAIC,EAAE,GAAG,CAAC;EAEV,MAAMC,kBAAkB,GAAGA,CACzBC,QAAsC,EACtCC,KAAa,GAAG,CAAC,EACjB,GAAGC,IAAe,KACf;IACH,MAAMC,SAAS,GAAGL,EAAE,EAAE;IAEtB,MAAMM,eAAe,GAAGA,CAAA,KAAM;MAC5B,IAAI,CAACR,eAAe,CAACS,GAAG,CAACF,SAAS,CAAC,EAAE;QACnC;MACF;MACAH,QAAQ,CAAC,GAAGE,IAAI,CAAC;MACjBN,eAAe,CAACU,MAAM,CAACH,SAAS,CAAC;IACnC,CAAC;IAEDP,eAAe,CAACW,GAAG,CAACJ,SAAS,CAAC;IAC9BT,QAAQ,CAACU,eAAe,EAAED,SAAS,EAAEF,KAAK,CAAC;IAC3C,OAAOE,SAAS;EAClB,CAAC;EAED,MAAMK,oBAAoB,GAAIC,aAAqB,IAAK;IACtDb,eAAe,CAACU,MAAM,CAACG,aAAa,CAAC;EACvC,CAAC;EAEDC,UAAU,CAACC,UAAU,GAAGZ,kBAAuC;EAC/DW,UAAU,CAACE,YAAY,GAAGJ,oBAA2C;AACvE","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/runtimeKind.js b/frontend-admin/node_modules/react-native-worklets/lib/module/runtimeKind.js index a7a03429..b0c7a193 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/runtimeKind.js +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/runtimeKind.js @@ -1,17 +1,8 @@ 'use strict'; export let RuntimeKind = /*#__PURE__*/function (RuntimeKind) { - /** - * The React Native runtime, which is the main runtime for React Native where - * React exists and where components are rendered. - */ RuntimeKind[RuntimeKind["ReactNative"] = 1] = "ReactNative"; - /** - * The UI runtime, which is a special runtime that executes on the UI thread, - * mostly used for animations and gestures. - */ RuntimeKind[RuntimeKind["UI"] = 2] = "UI"; - /** Additional runtime created on-demand by the user. */ RuntimeKind[RuntimeKind["Worker"] = 3] = "Worker"; return RuntimeKind; }({}); diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/runtimeKind.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/runtimeKind.js.map index 4c998410..6e293479 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/runtimeKind.js.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/runtimeKind.js.map @@ -1 +1 @@ -{"version":3,"names":["RuntimeKind","getRuntimeKind","globalThis","__RUNTIME_KIND","undefined","ReactNative"],"sourceRoot":"../../src","sources":["runtimeKind.ts"],"mappings":"AAAA,YAAY;;AAEZ,WAAYA,WAAW,0BAAXA,WAAW;EACrB;AACF;AACA;AACA;EAJYA,WAAW,CAAXA,WAAW;EAMrB;AACF;AACA;AACA;EATYA,WAAW,CAAXA,WAAW;EAWrB;EAXUA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;;AAevB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAgB;EAC5C,SAAS;;EACT,OAAOC,UAAU,CAACC,cAAc;AAClC;AAEA,IAAID,UAAU,CAACC,cAAc,KAAKC,SAAS,EAAE;EAC3C;EACA;EACA;EACAF,UAAU,CAACC,cAAc,GAAGH,WAAW,CAACK,WAAW;AACrD","ignoreList":[]} +{"version":3,"names":["RuntimeKind","getRuntimeKind","globalThis","__RUNTIME_KIND","undefined","ReactNative"],"sourceRoot":"../../src","sources":["runtimeKind.ts"],"mappings":"AAAA,YAAY;;AAEZ,WAAYA,WAAW,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;;AAevB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAgB;EAC5C,SAAS;;EACT,OAAOC,UAAU,CAACC,cAAc;AAClC;AAEA,IAAID,UAAU,CAACC,cAAc,KAAKC,SAAS,EAAE;EAC3C;EACA;EACA;EACAF,UAAU,CAACC,cAAc,GAAGH,WAAW,CAACK,WAAW;AACrD","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/runtimes.js b/frontend-admin/node_modules/react-native-worklets/lib/module/runtimes.js index c447ea7c..0a41f86f 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/runtimes.js +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/runtimes.js @@ -1,13 +1,100 @@ 'use strict'; -import { WorkletsError } from './debug/WorkletsError'; -export function createWorkletRuntime() { - throw new WorkletsError('`createWorkletRuntime` is not supported on web.'); +import { setupCallGuard } from "./callGuard.js"; +import { getMemorySafeCapturableConsole, setupConsole } from "./initializers.js"; +import { SHOULD_BE_USE_WEB } from "./PlatformChecker/index.js"; +import { setupRunLoop } from "./runLoop/workletRuntime/index.js"; +import { RuntimeKind } from "./runtimeKind.js"; +import { createSerializable, makeShareableCloneOnUIRecursive } from "./serializable.js"; +import { isWorkletFunction } from "./workletFunction.js"; +import { registerWorkletsError, WorkletsError } from "./WorkletsError.js"; +import { WorkletsModule } from "./WorkletsModule/index.js"; + +/** + * Lets you create a new JS runtime which can be used to run worklets possibly + * on different threads than JS or UI thread. + * + * @param config - Runtime configuration object - {@link WorkletRuntimeConfig}. + * @returns WorkletRuntime which is a + * `jsi::HostObject` - {@link WorkletRuntime} + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/ + */ +// @ts-expect-error Public API overload. + +/** + * @deprecated Please use the new config object signature instead: + * `createWorkletRuntime({ name, initializer })` + * + * Lets you create a new JS runtime which can be used to run worklets possibly + * on different threads than JS or UI thread. + * @param name - A name used to identify the runtime which will appear in + * devices list in Chrome DevTools. + * @param initializer - An optional worklet that will be run synchronously on + * the same thread immediately after the runtime is created. + * @returns WorkletRuntime which is a + * `jsi::HostObject` - {@link WorkletRuntime} + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/ + */ + +export function createWorkletRuntime(nameOrConfig, initializer) { + const runtimeBoundCapturableConsole = getMemorySafeCapturableConsole(); + let name; + let initializerFn; + let useDefaultQueue = true; + let customQueue; + let animationQueuePollingRate; + let enableEventLoop = true; + if (typeof nameOrConfig === 'string') { + name = nameOrConfig; + initializerFn = initializer; + } else { + // TODO: Make anonymous name globally unique. + name = nameOrConfig?.name ?? 'anonymous'; + initializerFn = nameOrConfig?.initializer; + useDefaultQueue = nameOrConfig?.useDefaultQueue ?? true; + customQueue = nameOrConfig?.customQueue; + animationQueuePollingRate = Math.round(nameOrConfig?.animationQueuePollingRate ?? 16); + enableEventLoop = nameOrConfig?.enableEventLoop ?? true; + } + if (initializerFn && !isWorkletFunction(initializerFn)) { + throw new WorkletsError('The initializer passed to `createWorkletRuntime` is not a worklet.'); + } + return WorkletsModule.createWorkletRuntime(name, createSerializable(() => { + 'worklet'; + + setupCallGuard(); + registerWorkletsError(); + setupConsole(runtimeBoundCapturableConsole); + if (enableEventLoop) { + setupRunLoop(animationQueuePollingRate); + } + initializerFn?.(); + }), useDefaultQueue, customQueue, enableEventLoop); } -export function runOnRuntime() { - throw new WorkletsError('`runOnRuntime` is not supported on web.'); -} -export function scheduleOnRuntime() { - throw new WorkletsError('`scheduleOnRuntime` is not supported on web.'); + +// @ts-expect-error Check `runOnUI` overload. + +/** Schedule a worklet to execute on the background queue. */ +export function runOnRuntime(workletRuntime, worklet) { + 'worklet'; + + if (__DEV__ && !SHOULD_BE_USE_WEB && !isWorkletFunction(worklet)) { + throw new WorkletsError('The function passed to `runOnRuntime` is not a worklet.'); + } + if (globalThis.__RUNTIME_KIND !== RuntimeKind.ReactNative) { + return (...args) => globalThis._scheduleOnRuntime(workletRuntime, makeShareableCloneOnUIRecursive(() => { + 'worklet'; + + worklet(...args); + })); + } + return (...args) => WorkletsModule.scheduleOnRuntime(workletRuntime, createSerializable(() => { + 'worklet'; + + worklet(...args); + globalThis.__flushMicrotasks(); + })); } + +/** Configuration object for creating a worklet runtime. */ //# sourceMappingURL=runtimes.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/runtimes.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/runtimes.js.map index 5dc730e2..967ded8b 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/runtimes.js.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/runtimes.js.map @@ -1 +1 @@ -{"version":3,"names":["WorkletsError","createWorkletRuntime","runOnRuntime","scheduleOnRuntime"],"sourceRoot":"../../src","sources":["runtimes.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,aAAa,QAAQ,uBAAuB;AAgBrD,OAAO,SAASC,oBAAoBA,CAAA,EAAU;EAC5C,MAAM,IAAID,aAAa,CAAC,iDAAiD,CAAC;AAC5E;AAOA,OAAO,SAASE,YAAYA,CAAA,EAAU;EACpC,MAAM,IAAIF,aAAa,CAAC,yCAAyC,CAAC;AACpE;AAQA,OAAO,SAASG,iBAAiBA,CAAA,EAAU;EACzC,MAAM,IAAIH,aAAa,CAAC,8CAA8C,CAAC;AACzE","ignoreList":[]} +{"version":3,"names":["setupCallGuard","getMemorySafeCapturableConsole","setupConsole","SHOULD_BE_USE_WEB","setupRunLoop","RuntimeKind","createSerializable","makeShareableCloneOnUIRecursive","isWorkletFunction","registerWorkletsError","WorkletsError","WorkletsModule","createWorkletRuntime","nameOrConfig","initializer","runtimeBoundCapturableConsole","name","initializerFn","useDefaultQueue","customQueue","animationQueuePollingRate","enableEventLoop","Math","round","runOnRuntime","workletRuntime","worklet","__DEV__","globalThis","__RUNTIME_KIND","ReactNative","args","_scheduleOnRuntime","scheduleOnRuntime","__flushMicrotasks"],"sourceRoot":"../../src","sources":["runtimes.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,cAAc,QAAQ,gBAAa;AAC5C,SAASC,8BAA8B,EAAEC,YAAY,QAAQ,mBAAgB;AAC7E,SAASC,iBAAiB,QAAQ,4BAAmB;AACrD,SAASC,YAAY,QAAQ,mCAA0B;AACvD,SAASC,WAAW,QAAQ,kBAAe;AAC3C,SACEC,kBAAkB,EAClBC,+BAA+B,QAC1B,mBAAgB;AACvB,SAASC,iBAAiB,QAAQ,sBAAmB;AACrD,SAASC,qBAAqB,EAAEC,aAAa,QAAQ,oBAAiB;AACtE,SAASC,cAAc,QAAQ,2BAAkB;;AAGjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAO,SAASC,oBAAoBA,CAClCC,YAAoD,EACpDC,WAAuC,EACvB;EAChB,MAAMC,6BAA6B,GAAGd,8BAA8B,CAAC,CAAC;EAEtE,IAAIe,IAAY;EACh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AAC;EACH;EACA,IAAIkB,UAAU,CAACC,cAAc,KAAKxB,WAAW,CAACyB,WAAW,EAAE;IACzD,OAAO,CAAC,GAAGC,IAAI,KACbH,UAAU,CAACI,kBAAkB,CAC3BP,cAAc,EACdlB,+BAA+B,CAAC,MAAM;MACpC,SAAS;;MACTmB,OAAO,CAAC,GAAGK,IAAI,CAAC;IAClB,CAAC,CACH,CAAC;EACL;EACA,OAAO,CAAC,GAAGA,IAAI,KACbpB,cAAc,CAACsB,iBAAiB,CAC9BR,cAAc,EACdnB,kBAAkB,CAAC,MAAM;IACvB,SAAS;;IACToB,OAAO,CAAC,GAAGK,IAAI,CAAC;IAChBH,UAAU,CAACM,iBAAiB,CAAC,CAAC;EAChC,CAAC,CACH,CAAC;AACL;;AAEA","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/runtimes.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/runtimes.native.js deleted file mode 100644 index c49ee28c..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/runtimes.native.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict'; - -import { setupCallGuard } from './callGuard'; -import { registerWorkletsError, WorkletsError } from './debug/WorkletsError'; -import { getMemorySafeCapturableConsole, setupConsole } from './initializers/initializers'; -import { createSerializable, makeShareableCloneOnUIRecursive } from './memory/serializable'; -import { setupRunLoop } from './runLoop/workletRuntime'; -import { RuntimeKind } from './runtimeKind'; -import { isWorkletFunction } from './workletFunction'; -import { WorkletsModule } from './WorkletsModule/NativeWorklets'; - -/** - * Lets you create a new JS runtime which can be used to run worklets possibly - * on different threads than JS or UI thread. - * - * @param config - Runtime configuration object - {@link WorkletRuntimeConfig}. - * @returns WorkletRuntime which is a - * `jsi::HostObject` - {@link WorkletRuntime} - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/ - */ -// @ts-expect-error Public API overload. - -/** - * @deprecated Please use the new config object signature instead: - * `createWorkletRuntime({ name, initializer })` - * - * Lets you create a new JS runtime which can be used to run worklets possibly - * on different threads than JS or UI thread. - * @param name - A name used to identify the runtime which will appear in - * devices list in Chrome DevTools. - * @param initializer - An optional worklet that will be run synchronously on - * the same thread immediately after the runtime is created. - * @returns WorkletRuntime which is a - * `jsi::HostObject` - {@link WorkletRuntime} - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/ - */ - -export function createWorkletRuntime(nameOrConfig, initializer) { - const runtimeBoundCapturableConsole = getMemorySafeCapturableConsole(); - let name; - let initializerFn; - let useDefaultQueue = true; - let customQueue; - let animationQueuePollingRate; - let enableEventLoop = true; - if (typeof nameOrConfig === 'string') { - name = nameOrConfig; - initializerFn = initializer; - } else { - // TODO: Make anonymous name globally unique. - name = nameOrConfig?.name ?? 'anonymous'; - initializerFn = nameOrConfig?.initializer; - useDefaultQueue = nameOrConfig?.useDefaultQueue ?? true; - customQueue = nameOrConfig?.customQueue; - animationQueuePollingRate = Math.round(nameOrConfig?.animationQueuePollingRate ?? 16); - enableEventLoop = nameOrConfig?.enableEventLoop ?? true; - } - if (initializerFn && !isWorkletFunction(initializerFn)) { - throw new WorkletsError('The initializer passed to `createWorkletRuntime` is not a worklet.'); - } - return WorkletsModule.createWorkletRuntime(name, createSerializable(() => { - 'worklet'; - - setupCallGuard(); - registerWorkletsError(); - setupConsole(runtimeBoundCapturableConsole); - if (enableEventLoop) { - setupRunLoop(animationQueuePollingRate); - } - initializerFn?.(); - }), useDefaultQueue, customQueue, enableEventLoop); -} - -/** - * Lets you asynchronously run a - * [worklet](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#worklet) - * on a [Worker - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime). - * - * Check - * {@link https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds} - * for more information about the different runtime kinds. - * - * - The worklet is scheduled on the Worker Runtime's [Async - * Queue](https://github.com/software-mansion/react-native-reanimated/blob/main/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h) - * - The function cannot be scheduled on the Worker Runtime from [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime) - * or another [Worker - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime), - * unless the [Bundle - * Mode](https://docs.swmansion.com/react-native-worklets/docs/experimental/bundleMode) - * is enabled. - * - * @param workletRuntime - The runtime to schedule the worklet on. - * @param worklet - The worklet to schedule. - * @param args - The arguments to pass to the worklet. - * @returns The return value of the worklet. - */ -// @ts-expect-error This overload is correct since it's what user sees in their code -// before it's transformed by Worklets Babel plugin. - -export function scheduleOnRuntime(workletRuntime, worklet, ...args) { - 'worklet'; - - if (__DEV__ && !isWorkletFunction(worklet)) { - throw new WorkletsError('The function passed to `scheduleOnRuntime` is not a worklet.'); - } - if (globalThis.__RUNTIME_KIND !== RuntimeKind.ReactNative) { - globalThis._scheduleOnRuntime(workletRuntime, makeShareableCloneOnUIRecursive(() => { - 'worklet'; - - worklet(...args); - })); - } - WorkletsModule.scheduleOnRuntime(workletRuntime, createSerializable(() => { - 'worklet'; - - worklet(...args); - globalThis.__flushMicrotasks(); - })); -} - -/** - * @deprecated Use `scheduleOnRuntime` instead. - * - * Schedule a worklet to execute on the background queue. - */ -// @ts-expect-error This overload is correct since it's what user sees in their code -// before it's transformed by Worklets Babel plugin. - -export function runOnRuntime(workletRuntime, worklet) { - 'worklet'; - - if (__DEV__ && !isWorkletFunction(worklet)) { - throw new WorkletsError('The function passed to `runOnRuntime` is not a worklet.'); - } - return (...args) => scheduleOnRuntime(workletRuntime, worklet, ...args); -} -//# sourceMappingURL=runtimes.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/runtimes.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/runtimes.native.js.map deleted file mode 100644 index 152e2c54..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/runtimes.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["setupCallGuard","registerWorkletsError","WorkletsError","getMemorySafeCapturableConsole","setupConsole","createSerializable","makeShareableCloneOnUIRecursive","setupRunLoop","RuntimeKind","isWorkletFunction","WorkletsModule","createWorkletRuntime","nameOrConfig","initializer","runtimeBoundCapturableConsole","name","initializerFn","useDefaultQueue","customQueue","animationQueuePollingRate","enableEventLoop","Math","round","scheduleOnRuntime","workletRuntime","worklet","args","__DEV__","globalThis","__RUNTIME_KIND","ReactNative","_scheduleOnRuntime","__flushMicrotasks","runOnRuntime"],"sourceRoot":"../../src","sources":["runtimes.native.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,cAAc,QAAQ,aAAa;AAC5C,SAASC,qBAAqB,EAAEC,aAAa,QAAQ,uBAAuB;AAC5E,SACEC,8BAA8B,EAC9BC,YAAY,QACP,6BAA6B;AACpC,SACEC,kBAAkB,EAClBC,+BAA+B,QAC1B,uBAAuB;AAC9B,SAASC,YAAY,QAAQ,0BAA0B;AACvD,SAASC,WAAW,QAAQ,eAAe;AAM3C,SAASC,iBAAiB,QAAQ,mBAAmB;AACrD,SAASC,cAAc,QAAQ,iCAAiC;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAO,SAASC,oBAAoBA,CAClCC,YAAoD,EACpDC,WAAuC,EACvB;EAChB,MAAMC,6BAA6B,GAAGX,8BAA8B,CAAC,CAAC;EAEtE,IAAIY,IAAY;EAChB,IAAIC,aAAuC;EAC3C,IAAIC,eAAe,GAAG,IAAI;EAC1B,IAAIC,WAA+B;EACnC,IAAIC,yBAAiC;EACrC,IAAIC,eAAe,GAAG,IAAI;EAC1B,IAAI,OAAOR,YAAY,KAAK,QAAQ,EAAE;IACpCG,IAAI,GAAGH,YAAY;IACnBI,aAAa,GAAGH,WAAW;EAC7B,CAAC,MA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dlB,+BAA+B,CAAC,MAAM;MACpC,SAAS;;MACTmB,OAAO,CAAC,GAAGC,IAAI,CAAC;IAClB,CAAC,CACH,CAAC;EACH;EAEAhB,cAAc,CAACa,iBAAiB,CAC9BC,cAAc,EACdnB,kBAAkB,CAAC,MAAM;IACvB,SAAS;;IACToB,OAAO,CAAC,GAAGC,IAAI,CAAC;IAChBE,UAAU,CAACI,iBAAiB,CAAC,CAAC;EAChC,CAAC,CACH,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAO,SAASC,YAAYA,CAC1BT,cAA8B,EAC9BC,OAA2C,EAClB;EACzB,SAAS;;EACT,IAAIE,OAAO,IAAI,CAAClB,iBAAiB,CAACgB,OAAO,CAAC,EAAE;IAC1C,MAAM,IAAIvB,aAAa,CACrB,yDACF,CAAC;EACH;EACA,OAAO,CAAC,GAAGwB,IAAI,KAAKH,iBAAiB,CAACC,cAAc,EAAEC,OAAO,EAAE,GAAGC,IAAI,CAAC;AACzE","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/specs/NativeWorkletsModule.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/specs/NativeWorkletsModule.js.map index 2022e941..7fde2987 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/specs/NativeWorkletsModule.js.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/specs/NativeWorkletsModule.js.map @@ -1 +1 @@ -{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeWorkletsModule.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAA2BA,mBAAmB,QAAQ,cAAc;AAMpE,eAAeA,mBAAmB,CAACC,GAAG,CAAO,gBAAgB,CAAC","ignoreList":[]} +{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeWorkletsModule.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,mBAAmB,QAAQ,cAAc;AAMlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,gBAAgB,CAAC","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/specs/index.js b/frontend-admin/node_modules/react-native-worklets/lib/module/specs/index.js index a80f7369..17ced554 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/specs/index.js +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/specs/index.js @@ -1,7 +1,7 @@ 'use strict'; -import { RuntimeKind } from '../runtimeKind'; -import RNWorkletsTurboModule from './NativeWorkletsModule'; +import { RuntimeKind } from "../runtimeKind.js"; +import RNWorkletsTurboModule from "./NativeWorkletsModule.js"; export const WorkletsTurboModule = globalThis.__RUNTIME_KIND === RuntimeKind.ReactNative ? RNWorkletsTurboModule : // In Bundle Mode, on Worklet Runtimes `RNWorkletsTurboModule` isn't // available and shouldn't be accessed. We return null here diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/specs/index.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/specs/index.js.map index ef302fcb..9f4fa7e3 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/specs/index.js.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/specs/index.js.map @@ -1 +1 @@ -{"version":3,"names":["RuntimeKind","RNWorkletsTurboModule","WorkletsTurboModule","globalThis","__RUNTIME_KIND","ReactNative"],"sourceRoot":"../../../src","sources":["specs/index.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,WAAW,QAAQ,gBAAgB;AAE5C,OAAOC,qBAAqB,MAAM,wBAAwB;AAE1D,OAAO,MAAMC,mBAA4C,GACvDC,UAAU,CAACC,cAAc,KAAKJ,WAAW,CAACK,WAAW,GACjDJ,qBAAqB;AACrB;AACA;AACA;AACA,IAAI","ignoreList":[]} +{"version":3,"names":["RuntimeKind","RNWorkletsTurboModule","WorkletsTurboModule","globalThis","__RUNTIME_KIND","ReactNative"],"sourceRoot":"../../../src","sources":["specs/index.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,WAAW,QAAQ,mBAAgB;AAE5C,OAAOC,qBAAqB,MAAM,2BAAwB;AAE1D,OAAO,MAAMC,mBAAgC,GAC3CC,UAAU,CAACC,cAAc,KAAKJ,WAAW,CAACK,WAAW,GACjDJ,qBAAqB;AACrB;AACA;AACA;AACA,IAAI","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/threads.js b/frontend-admin/node_modules/react-native-worklets/lib/module/threads.js index ea988b09..9a337f4c 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/threads.js +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/threads.js @@ -1,36 +1,311 @@ 'use strict'; -import { WorkletsError } from './debug/WorkletsError'; -import { mockedRequestAnimationFrame } from './runLoop/uiRuntime/mockedRequestAnimationFrame'; -export function callMicrotasks() { - // on web flushing is a noop as immediates are handled by the browser -} -export function scheduleOnUI(worklet, ...args) { - enqueueUI(worklet, args); -} -export function runOnUI(worklet) { - return (...args) => { - scheduleOnUI(worklet, ...args); +import { IS_JEST, SHOULD_BE_USE_WEB } from "./PlatformChecker/index.js"; +import { RuntimeKind } from "./runtimeKind.js"; +import { createSerializable, makeShareableCloneOnUIRecursive } from "./serializable.js"; +import { serializableMappingCache } from "./serializableMappingCache.js"; +import { isWorkletFunction } from "./workletFunction.js"; +import { WorkletsError } from "./WorkletsError.js"; +import { WorkletsModule } from "./WorkletsModule/index.js"; +let runOnUIQueue = []; +export function setupMicrotasks() { + 'worklet'; + + let microtasksQueue = []; + let isExecutingMicrotasksQueue = false; + global.queueMicrotask = callback => { + microtasksQueue.push(callback); + }; + global._microtaskQueueFinalizers = []; + global.__callMicrotasks = () => { + if (isExecutingMicrotasksQueue) { + return; + } + try { + isExecutingMicrotasksQueue = true; + for (let index = 0; index < microtasksQueue.length; index += 1) { + // we use classic 'for' loop because the size of the currentTasks array may change while executing some of the callbacks due to queueMicrotask calls + microtasksQueue[index](); + } + microtasksQueue = []; + global._microtaskQueueFinalizers.forEach(finalizer => finalizer()); + } finally { + isExecutingMicrotasksQueue = false; + } }; } -export function runOnUISync() { - throw new WorkletsError('`runOnUISync` is not supported on web.'); +function callMicrotasksOnUIThread() { + 'worklet'; + + global.__callMicrotasks(); } -export function executeOnUIRuntimeSync() { - throw new WorkletsError('`executeOnUIRuntimeSync` is not supported on web.'); +export const callMicrotasks = SHOULD_BE_USE_WEB ? () => { + // on web flushing is a noop as immediates are handled by the browser +} : callMicrotasksOnUIThread; + +/** + * Lets you schedule a function to be executed on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * + * - The callback executes asynchronously and doesn't return a value. + * - Passed function and args are automatically + * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) + * and serialized. + * - This function cannot be called from the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime) + * or [Worker + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#worker-worklet-runtime---worker-runtime), + * unless you have the [Bundle Mode](/docs/experimental/bundleMode) enabled. + * + * @param fun - A reference to a function you want to schedule on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * @param args - Arguments to pass to the function. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnUI + */ +export function scheduleOnUI(worklet, ...args) { + runOnUI(worklet)(...args); } + +/** + * Lets you asynchronously run + * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) + * functions on the [UI + * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/). + * + * This method does not schedule the work immediately but instead waits for + * other worklets to be scheduled within the same JS loop. It uses + * queueMicrotask to schedule all the worklets at once making sure they will run + * within the same frame boundaries on the UI thread. + * + * @param fun - A reference to a function you want to execute on the [UI + * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/) + * from the [JavaScript + * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/). + * @returns A function that accepts arguments for the function passed as the + * first argument. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI @deprecated Use `scheduleOnUI` instead. + */ +// @ts-expect-error This overload is correct since it's what user sees in his code +// before it's transformed by Reanimated Babel plugin. + +export function runOnUI(worklet) { + if (__DEV__ && !SHOULD_BE_USE_WEB && !isWorkletFunction(worklet) && !worklet.__bundleData) { + throw new WorkletsError('`runOnUI` can only be used with worklets.'); + } + return (...args) => { + if (IS_JEST) { + // Mocking time in Jest is tricky as both requestAnimationFrame and queueMicrotask + // callbacks run on the same queue and can be interleaved. There is no way + // to flush particular queue in Jest and the only control over mocked timers + // is by using jest.advanceTimersByTime() method which advances all types + // of timers including immediate and animation callbacks. Ideally we'd like + // to have some way here to schedule work along with React updates, but + // that's not possible, and hence in Jest environment instead of using scheduling + // mechanism we just schedule the work ommiting the queue. This is ok for the + // uses that we currently have but may not be ok for future tests that we write. + WorkletsModule.scheduleOnUI(createSerializable(() => { + 'worklet'; + + worklet(...args); + })); + return; + } + if (__DEV__) { + // in DEV mode we call serializable conversion here because in case the object + // can't be converted, we will get a meaningful stack-trace as opposed to the + // situation when conversion is only done via microtask queue. This does not + // make the app particularily less efficient as converted objects are cached + // and for a given worklet the conversion only happens once. + createSerializable(worklet); + createSerializable(args); + } + enqueueUI(worklet, args); + }; +} +if (__DEV__) { + function runOnUIWorklet() { + 'worklet'; + + throw new WorkletsError('`runOnUI` cannot be called on the UI runtime. Please call the function synchronously or use `queueMicrotask` or `requestAnimationFrame` instead.'); + } + const serializableRunOnUIWorklet = createSerializable(runOnUIWorklet); + serializableMappingCache.set(runOnUI, serializableRunOnUIWorklet); +} + +/** + * Lets you run a function synchronously on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime) + * from the [RN + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#react-native-runtime-rn-runtime). + * Passed function and args are automatically + * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) + * and serialized. + * + * - This function cannot be called from the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * - This function cannot be called from a [Worker + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#worker-worklet-runtime---worker-runtime). + * + * @param fun - A reference to a function you want to execute on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * @param args - Arguments to pass to the function. + * @returns The return value of the function passed as the first argument. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUISync + */ +export function runOnUISync(worklet, ...args) { + return executeOnUIRuntimeSync(worklet)(...args); +} + +// @ts-expect-error Check `executeOnUIRuntimeSync` overload above. + +export function executeOnUIRuntimeSync(worklet) { + return (...args) => { + return WorkletsModule.executeOnUIRuntimeSync(createSerializable(() => { + 'worklet'; + + const result = worklet(...args); + return makeShareableCloneOnUIRecursive(result); + })); + }; +} +function runWorkletOnJS(worklet, ...args) { + // remote function that calls a worklet synchronously on the JS runtime + worklet(...args); +} + +/** + * Lets you asynchronously run + * non-[workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) + * functions that couldn't otherwise run on the [UI + * thread](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-thread). + * This applies to most external libraries as they don't have their functions + * marked with "worklet"; directive. + * + * @param fun - A reference to a function you want to execute on the JavaScript + * thread from the UI thread. + * @returns A function that accepts arguments for the function passed as the + * first argument. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnJS + */ +/** @deprecated Use `scheduleOnRN` instead. */ export function runOnJS(fun) { - return (...args) => scheduleOnRN(fun, ...args); + 'worklet'; + + if (SHOULD_BE_USE_WEB || globalThis.__RUNTIME_KIND === RuntimeKind.ReactNative) { + // if we are already on the JS thread, we just schedule the worklet on the JS queue + return (...args) => queueMicrotask(args.length ? () => fun(...args) : fun); + } + if (isWorkletFunction(fun)) { + // If `fun` is a worklet, we schedule a call of a remote function `runWorkletOnJS` + // and pass the worklet as a first argument followed by original arguments. + + return (...args) => runOnJS(runWorkletOnJS)(fun, ...args); + } + if (fun.__remoteFunction) { + // In development mode the function provided as `fun` throws an error message + // such that when someone accidentally calls it directly on the UI runtime, they + // see that they should use `runOnJS` instead. To facilitate that we put the + // reference to the original remote function in the `__remoteFunction` property. + fun = fun.__remoteFunction; + } + const scheduleOnJS = typeof fun === 'function' ? global._scheduleHostFunctionOnJS : global._scheduleRemoteFunctionOnJS; + return (...args) => { + scheduleOnJS(fun, args.length > 0 ? makeShareableCloneOnUIRecursive(args) : undefined); + }; } + +/** + * Lets you schedule a function to be executed on the RN runtime from any + * runtime. Check + * {@link https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds} + * for more information about the different runtime kinds. + * + * Scheduling function from the RN Runtime (we are already on RN Runtime) simply + * uses `queueMicrotask`. + * + * When functions need to be scheduled from the UI Runtime, first function and + * args are serialized and then the system passes the scheduling responsibility + * to the JSScheduler. The JSScheduler then uses the RN CallInvoker to schedule + * the function asynchronously on the JavaScript thread by calling + * `jsCallInvoker_->invokeAsync()`. + * + * When called from a Worker Runtime, it uses the same JSScheduler mechanism. + * + * @param fun - A function you want to schedule on the RN runtime. A function + * can be a worklet, a remote function or a regular function. + * @param args - Arguments to pass to the function. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnRN + */ export function scheduleOnRN(fun, ...args) { - queueMicrotask(args.length ? () => fun(...args) : fun); + 'worklet'; + + runOnJS(fun)(...args); } -export function runOnUIAsync(worklet, ...args) { - return new Promise(resolve => { - enqueueUI(worklet, args, resolve); - }); + +/** + * Lets you asynchronously run + * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) + * functions on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * + * This method does not schedule the work immediately but instead waits for + * other worklets to be scheduled within the same JS loop. It uses + * queueMicrotask to schedule all the worklets at once making sure they will run + * within the same frame boundaries on the UI thread. + * + * @param fun - A reference to a function you want to execute on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * from the [JavaScript + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#javascript-runtime). + * @returns A promise that resolves to the return value of the function passed + * as the first argument. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUIAsync + */ +export function runOnUIAsync(worklet) { + if (__DEV__ && !SHOULD_BE_USE_WEB && !isWorkletFunction(worklet)) { + throw new WorkletsError('`runOnUIAsync` can only be used with worklets.'); + } + return (...args) => { + return new Promise(resolve => { + if (IS_JEST) { + // Mocking time in Jest is tricky as both requestAnimationFrame and queueMicrotask + // callbacks run on the same queue and can be interleaved. There is no way + // to flush particular queue in Jest and the only control over mocked timers + // is by using jest.advanceTimersByTime() method which advances all types + // of timers including immediate and animation callbacks. Ideally we'd like + // to have some way here to schedule work along with React updates, but + // that's not possible, and hence in Jest environment instead of using scheduling + // mechanism we just schedule the work ommiting the queue. This is ok for the + // uses that we currently have but may not be ok for future tests that we write. + WorkletsModule.scheduleOnUI(createSerializable(() => { + 'worklet'; + + worklet(...args); + })); + return; + } + if (__DEV__) { + // in DEV mode we call serializable conversion here because in case the object + // can't be converted, we will get a meaningful stack-trace as opposed to the + // situation when conversion is only done via microtask queue. This does not + // make the app particularily less efficient as converted objects are cached + // and for a given worklet the conversion only happens once. + createSerializable(worklet); + createSerializable(args); + } + enqueueUI(worklet, args, resolve); + }); + }; +} +if (__DEV__) { + function runOnUIAsyncWorklet() { + 'worklet'; + + throw new WorkletsError('`runOnUIAsync` cannot be called on the UI runtime. Please call the function synchronously or use `queueMicrotask` or `requestAnimationFrame` instead.'); + } + const serializableRunOnUIAsyncWorklet = createSerializable(runOnUIAsyncWorklet); + serializableMappingCache.set(runOnUIAsync, serializableRunOnUIAsyncWorklet); } -let runOnUIQueue = []; function enqueueUI(worklet, args, resolve) { const job = [worklet, args, resolve]; runOnUIQueue.push(job); @@ -42,20 +317,31 @@ function flushUIQueue() { queueMicrotask(() => { const queue = runOnUIQueue; runOnUIQueue = []; - requestAnimationFrameImpl(() => { + WorkletsModule.scheduleOnUI(createSerializable(() => { + 'worklet'; + queue.forEach(([workletFunction, workletArgs, jobResolve]) => { const result = workletFunction(...workletArgs); if (jobResolve) { - jobResolve(result); + runOnJS(jobResolve)(result); } }); - }); + callMicrotasks(); + })); }); } +/** + * Added temporarily for integration with `react-native-audio-api`. Don't depend + * on this API as it may change without notice. + */ // eslint-disable-next-line camelcase -export function unstable_eventLoopTask() { - throw new WorkletsError('`unstable_eventLoopTask` is not supported on web.'); +export function unstable_eventLoopTask(worklet) { + return (...args) => { + 'worklet'; + + worklet(...args); + callMicrotasks(); + }; } -const requestAnimationFrameImpl = !globalThis.requestAnimationFrame ? mockedRequestAnimationFrame : globalThis.requestAnimationFrame; //# sourceMappingURL=threads.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/threads.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/threads.js.map index a0ac3650..9f3e03eb 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/threads.js.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/threads.js.map @@ -1 +1 @@ -{"version":3,"names":["WorkletsError","mockedRequestAnimationFrame","callMicrotasks","scheduleOnUI","worklet","args","enqueueUI","runOnUI","runOnUISync","executeOnUIRuntimeSync","runOnJS","fun","scheduleOnRN","queueMicrotask","length","runOnUIAsync","Promise","resolve","runOnUIQueue","job","push","flushUIQueue","queue","requestAnimationFrameImpl","forEach","workletFunction","workletArgs","jobResolve","result","unstable_eventLoopTask","globalThis","requestAnimationFrame"],"sourceRoot":"../../src","sources":["threads.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,aAAa,QAAQ,uBAAuB;AACrD,SAASC,2BAA2B,QAAQ,iDAAiD;AAE7F,OAAO,SAASC,cAAcA,CA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BO,YAAY,CAAC,CAAC;EAChB;AACF;AAEA,SAASA,YAAYA,CAAA,EAAS;EAC5BR,cAAc,CAAC,MAAM;IACnB,MAAMS,KAAK,GAAGJ,YAAY;IAC1BA,YAAY,GAAG,EAAE;IACjBK,yBAAyB,CAAC,MAAM;MAC9BD,KAAK,CAACE,OAAO,CAAC,CAAC,CAACC,eAAe,EAAEC,WAAW,EAAEC,UAAU,CAAC,KAAK;QAC5D,MAAMC,MAAM,GAAGH,eAAe,CAAC,GAAGC,WAAW,CAAC;QAC9C,IAAIC,UAAU,EAAE;UACdA,UAAU,CAACC,MAAM,CAAC;QACpB;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ;;AAEA;AACA,OAAO,SAASC,sBAAsBA,CAAA,EAAU;EAC9C,MAAM,IAAI7B,aAAa,CAAC,mDAAmD,CAAC;AAC9E;AAEA,MAAMuB,yBAAyB,GAAG,CAACO,UAAU,CAACC,qBAAqB,GAC/D9B,2BAA2B,GAC3B6B,UAAU,CAACC,qBAAqB","ignoreList":[]} +{"version":3,"names":["IS_JEST","SHOULD_BE_USE_WEB","RuntimeKind","createSerializable","makeShareableCloneOnUIRecursive","serializableMappingCache","isWorkletFunction","WorkletsError","WorkletsModule","runOnUIQueue","setupMicrotasks","microtasksQueue","isExecutingMicrotasksQueue","global","queueMicrotask","callback","push","_microtaskQueueFinalizers","__callMicrotasks","index","length","forEach","finalizer","callMicrotasksOnUIThread","callMicrotasks","scheduleOnUI","worklet","args","runOnUI","__DEV__","__bundleData","enqueueUI","runOnUIWorklet","serializableRunOnUIWorklet","set","runOnUISync","executeOnUIRuntimeSync","result","runWorkletOnJS","runOnJS","fun","globalThis","__RUNTIME_KIND","ReactNative","__remoteFunction","scheduleOnJS","_scheduleHostFunctionOnJS","_scheduleRemoteFunctionOnJS","undefined","scheduleOnRN","runOnUIAsync","Promise","resolve","runOnUIAsyncWorklet","serializableRunOnUIAsyncWorklet","job","flushUIQueue","queue","workletFun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CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASqC,sBAAsBA,CACpCnC,OAAiC,EACjC;EACA,OAAO,CAAC,GAAGC,IAAW,KAAK;IACzB,SAAS;;IACTD,OAAO,CAAC,GAAGC,IAAI,CAAC;IAChBH,cAAc,CAAC,CAAC;EAClB,CAAC;AACH","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/threads.native.js b/frontend-admin/node_modules/react-native-worklets/lib/module/threads.native.js deleted file mode 100644 index 22d24cd2..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/threads.native.js +++ /dev/null @@ -1,319 +0,0 @@ -'use strict'; - -import { WorkletsError } from './debug/WorkletsError'; -import { createSerializable, makeShareableCloneOnUIRecursive } from './memory/serializable'; -import { serializableMappingCache } from './memory/serializableMappingCache'; -import { RuntimeKind } from './runtimeKind'; -import { isWorkletFunction } from './workletFunction'; -import { WorkletsModule } from './WorkletsModule/NativeWorklets'; -let runOnUIQueue = []; -export function setupMicrotasks() { - 'worklet'; - - let microtasksQueue = []; - let isExecutingMicrotasksQueue = false; - globalThis.queueMicrotask = callback => { - microtasksQueue.push(callback); - }; - globalThis._microtaskQueueFinalizers = []; - globalThis.__callMicrotasks = () => { - if (isExecutingMicrotasksQueue) { - return; - } - try { - isExecutingMicrotasksQueue = true; - for (let index = 0; index < microtasksQueue.length; index += 1) { - // we use classic 'for' loop because the size of the currentTasks array may change while executing some of the callbacks due to queueMicrotask calls - microtasksQueue[index](); - } - microtasksQueue = []; - globalThis._microtaskQueueFinalizers.forEach(finalizer => finalizer()); - } finally { - isExecutingMicrotasksQueue = false; - } - }; -} -function callMicrotasksOnUIThread() { - 'worklet'; - - globalThis.__callMicrotasks(); -} -export const callMicrotasks = callMicrotasksOnUIThread; - -/** - * Lets you schedule a function to be executed on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * - * - The callback executes asynchronously and doesn't return a value. - * - Passed function and args are automatically - * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) - * and serialized. - * - This function cannot be called from the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime) - * or a [Worker - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime), - * unless you have the [Bundle Mode](/docs/experimental/bundleMode) enabled. - * - * @param fun - A reference to a function you want to schedule on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * @param args - Arguments to pass to the function. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnUI - */ -// @ts-expect-error This overload is correct since it's what user sees in their code -// before it's transformed by Worklets Babel plugin. - -export function scheduleOnUI(worklet, ...args) { - if (__DEV__ && !isWorkletFunction(worklet) && !worklet.__bundleData) { - throw new WorkletsError('`scheduleOnUI` can only be used with worklets.'); - } - if (__DEV__) { - // in DEV mode we call serializable conversion here because in case the object - // can't be converted, we will get a meaningful stack-trace as opposed to the - // situation when conversion is only done via microtask queue. This does not - // make the app particularily less efficient as converted objects are cached - // and for a given worklet the conversion only happens once. - createSerializable(worklet); - createSerializable(args); - } - enqueueUI(worklet, args); -} - -/** - * Lets you asynchronously run - * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) - * functions on the [UI - * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/). - * - * This method does not schedule the work immediately but instead waits for - * other worklets to be scheduled within the same JS loop. It uses - * queueMicrotask to schedule all the worklets at once making sure they will run - * within the same frame boundaries on the UI thread. - * - * @param fun - A reference to a function you want to execute on the [UI - * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/) - * from the [JavaScript - * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/). - * @returns A function that accepts arguments for the function passed as the - * first argument. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI @deprecated Use `scheduleOnUI` instead. - */ -// @ts-expect-error This overload is correct since it's what user sees in their code -// before it's transformed by Worklets Babel plugin. - -export function runOnUI(worklet) { - if (__DEV__ && !isWorkletFunction(worklet) && !worklet.__bundleData) { - throw new WorkletsError('`runOnUI` can only be used with worklets.'); - } - return (...args) => { - scheduleOnUI(worklet, ...args); - }; -} -if (__DEV__) { - function runOnUIWorklet() { - 'worklet'; - - throw new WorkletsError('`runOnUI` cannot be called on the UI runtime. Please call the function synchronously or use `queueMicrotask` or `requestAnimationFrame` instead.'); - } - const serializableRunOnUIWorklet = createSerializable(runOnUIWorklet); - serializableMappingCache.set(runOnUI, serializableRunOnUIWorklet); -} - -/** - * Lets you run a function synchronously on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime) - * from the [RN - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#rn-runtime). - * Passed function and args are automatically - * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) - * and serialized. - * - * - This function cannot be called from the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * - This function cannot be called from a [Worker - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime). - * - * @param fun - A reference to a function you want to execute on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * @param args - Arguments to pass to the function. - * @returns The return value of the function passed as the first argument. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUISync - */ -// @ts-expect-error This overload is correct since it's what user sees in their code -// before it's transformed by Worklets Babel plugin. - -export function runOnUISync(worklet, ...args) { - return WorkletsModule.executeOnUIRuntimeSync(createSerializable(() => { - 'worklet'; - - const result = worklet(...args); - return makeShareableCloneOnUIRecursive(result); - })); -} - -// @ts-expect-error This overload is correct since it's what user sees in their code -// before it's transformed by Worklets Babel plugin. - -export function executeOnUIRuntimeSync(worklet) { - return (...args) => { - return runOnUISync(worklet, ...args); - }; -} -function runWorkletOnJS(worklet, ...args) { - // remote function that calls a worklet synchronously on the JS runtime - worklet(...args); -} - -/** - * Lets you schedule a function to be executed on the RN runtime from any - * runtime. Check - * {@link https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds} - * for more information about the different runtime kinds. - * - * Scheduling function from the RN Runtime (we are already on RN Runtime) simply - * uses `queueMicrotask`. - * - * When functions need to be scheduled from the UI Runtime, first function and - * args are serialized and then the system passes the scheduling responsibility - * to the JSScheduler. The JSScheduler then uses the RN CallInvoker to schedule - * the function asynchronously on the JavaScript thread by calling - * `jsCallInvoker_->invokeAsync()`. - * - * When called from a Worker Runtime, it uses the same JSScheduler mechanism. - * - * @param fun - A function you want to schedule on the RN runtime. A function - * can be a worklet, a remote function or a regular function. - * @param args - Arguments to pass to the function. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnRN - */ -export function scheduleOnRN(fun, ...args) { - 'worklet'; - - if (globalThis.__RUNTIME_KIND === RuntimeKind.ReactNative) { - // if we are already on the JS thread, we just schedule the worklet on the JS queue - queueMicrotask(args.length ? () => fun(...args) : fun); - return; - } - if (isWorkletFunction(fun)) { - // If `fun` is a worklet, we schedule a call of a remote function `runWorkletOnJS` - // and pass the worklet as a first argument followed by original arguments. - scheduleOnRN(runWorkletOnJS, fun, ...args); - return; - } - if (fun.__remoteFunction) { - // In development mode the function provided as `fun` throws an error message - // such that when someone accidentally calls it directly on the UI runtime, they - // see that they should use `runOnJS` instead. To facilitate that we put the - // reference to the original remote function in the `__remoteFunction` property. - fun = fun.__remoteFunction; - } - const scheduleOnRNImpl = typeof fun === 'function' ? globalThis._scheduleHostFunctionOnJS : globalThis._scheduleRemoteFunctionOnJS; - scheduleOnRNImpl(fun, args.length > 0 ? makeShareableCloneOnUIRecursive(args) : undefined); -} - -/** - * Lets you asynchronously run - * non-[workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) - * functions that couldn't otherwise run on the [UI - * thread](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-thread). - * This applies to most external libraries as they don't have their functions - * marked with "worklet"; directive. - * - * @param fun - A reference to a function you want to execute on the JavaScript - * thread from the UI thread. - * @returns A function that accepts arguments for the function passed as the - * first argument. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnJS - */ -/** @deprecated Use `scheduleOnRN` instead. */ -export function runOnJS(fun) { - 'worklet'; - - return (...args) => { - scheduleOnRN(fun, ...args); - }; -} - -/** - * Lets you asynchronously run - * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) - * functions on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * - * This method does not schedule the work immediately but instead waits for - * other worklets to be scheduled within the same JS loop. It uses - * queueMicrotask to schedule all the worklets at once making sure they will run - * within the same frame boundaries on the UI thread. - * - * @param fun - A reference to a function you want to execute on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * from the [JavaScript - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#javascript-runtime). - * @returns A promise that resolves to the return value of the function passed - * as the first argument. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUIAsync - */ -export function runOnUIAsync(worklet, ...args) { - if (__DEV__ && !isWorkletFunction(worklet)) { - throw new WorkletsError('`runOnUIAsync` can only be used with worklets.'); - } - return new Promise(resolve => { - if (__DEV__) { - // in DEV mode we call serializable conversion here because in case the object - // can't be converted, we will get a meaningful stack-trace as opposed to the - // situation when conversion is only done via microtask queue. This does not - // make the app particularily less efficient as converted objects are cached - // and for a given worklet the conversion only happens once. - createSerializable(worklet); - createSerializable(args); - } - enqueueUI(worklet, args, resolve); - }); -} -if (__DEV__) { - function runOnUIAsyncWorklet() { - 'worklet'; - - throw new WorkletsError('`runOnUIAsync` cannot be called on the UI runtime. Please call the function synchronously or use `queueMicrotask` or `requestAnimationFrame` instead.'); - } - const serializableRunOnUIAsyncWorklet = createSerializable(runOnUIAsyncWorklet); - serializableMappingCache.set(runOnUIAsync, serializableRunOnUIAsyncWorklet); -} -function enqueueUI(worklet, args, resolve) { - const job = [worklet, args, resolve]; - runOnUIQueue.push(job); - if (runOnUIQueue.length === 1) { - flushUIQueue(); - } -} -function flushUIQueue() { - queueMicrotask(() => { - const queue = runOnUIQueue; - runOnUIQueue = []; - WorkletsModule.scheduleOnUI(createSerializable(() => { - 'worklet'; - - queue.forEach(([workletFunction, workletArgs, jobResolve]) => { - const result = workletFunction(...workletArgs); - if (jobResolve) { - runOnJS(jobResolve)(result); - } - }); - callMicrotasks(); - })); - }); -} - -/** - * Added temporarily for integration with `react-native-audio-api`. Don't depend - * on this API as it may change without notice. - */ -// eslint-disable-next-line camelcase -export function unstable_eventLoopTask(worklet) { - return (...args) => { - 'worklet'; - - worklet(...args); - callMicrotasks(); - }; -} -//# sourceMappingURL=threads.native.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/threads.native.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/threads.native.js.map deleted file mode 100644 index 868f1575..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/threads.native.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["WorkletsError","createSerializable","makeShareableCloneOnUIRecursive","serializableMappingCache","RuntimeKind","isWorkletFunction","WorkletsModule","runOnUIQueue","setupMicrotasks","microtasksQueue","isExecutingMicrotasksQueue","globalThis","queueMicrotask","callback","push","_microtaskQueueFinalizers","__callMicrotasks","index","length","forEach","finalizer","callMicrotasksOnUIThread","callMicrotasks","scheduleOnUI","worklet","args","__DEV__","__bundleData","enqueueUI","runOnUI","runOnUIWorklet","serializableRunOnUIWorklet","set","runOnUISync","executeOnUIRuntimeSync","result","runWorkletOnJS","scheduleOnRN","fun","__RUNTIME_KIND","ReactNative","__remoteFunction","scheduleOnRNImpl","_scheduleHostFunctionOnJS","_scheduleRemoteFunctionOnJS","undefined","runOnJS","runOnUIAsync","Promise","resolve","runOnUIAsyncWorklet","serializableRunOnUIAsyncWorklet","job","flushUIQueue","queue","workletFunction","workletArgs","jobResolve","unstable_eventLoopTask"],"sourceRoot":"../../src","sources":["threads.native.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,aAAa,QAAQ,uBAAuB;AACrD,SACEC,kBAAkB,EAClBC,+BAA+B,QAC1B,uBAAuB;AAC9B,SAASC,wBAAwB,QAAQ,mCAAmC;AAC5E,SAASC,WAAW,QAAQ,eAAe;AAE3C,SAASC,iBAAiB,QAAQ,mBAAmB;AACrD,SAASC,cAAc,QAAQ,iCAAiC;AAQhE,IAAIC,YAAqB,GAAG,EAAE;AAE9B,OAAO,SAASC,eAAeA,CAAA,EAAG;EAChC,SAAS;;EAET,IAAIC,eAAkC,GAAG,EAAE;EAC3C,IAAIC,0BAA0B,GAAG,KAAK;EACtCC,UAAU,CAACC,cAAc,GAAIC,QAAoB,IAAK;IACpDJ,eAAe,CAACK,IAAI,CAACD,QAAQ,CAAC;EAChC,CAAC;EACDF,UAAU,CAACI,yBAAyB,GAAG,EAAE;EAEzCJ,UAAU,CAACK,gBAAgB,GAAG,MAAM;IAClC,IAAIN,0BAA0B,EAAE;MAC9B;IACF;IACA,IAAI;MACFA,0BAA0B,GAAG,IAAI;MACjC,KAAK,IAAIO,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGR,eAAe,CAACS,MAAM,EAAED,KAAK,IAAI,CAAC,EAAE;QAC9D;QACAR,eAAe,CAACQ,KAAK,CAAC,CAAC,CAAC;MAC1B;MACAR,eAAe,GAAG,EAAE;MACpBE,UAAU,CAACI,yBAAyB,CAACI,OAAO,CAAEC,SAAS,IAAKA,SAAS,CAAC,CAAC,CAAC;IAC1E,CAAC,SAAS;MACRV,0BAA0B,GAAG,KAAK;IACpC;EACF,CAAC;AACH;AAE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,CAAC;EACH;EAEA,MAAMmD,+BAA+B,GACnClD,kBAAkB,CAACiD,mBAAmB,CAAC;EACzC/C,wBAAwB,CAAC6B,GAAG,CAACe,YAAY,EAAEI,+BAA+B,CAAC;AAC7E;AAEA,SAASvB,SAASA,CAChBJ,OAA2C,EAC3CC,IAAU,EACVwB,OAAsC,EAChC;EACN,MAAMG,GAAG,GAAG,CAAC5B,OAAO,EAAEC,IAAI,EAAEwB,OAAO,CAA6B;EAChE1C,YAAY,CAACO,IAAI,CAACsC,GAAuB,CAAC;EAC1C,IAAI7C,YAAY,CAACW,MAAM,KAAK,CAAC,EAAE;IAC7BmC,YAAY,CAAC,CAAC;EAChB;AACF;AAEA,SAASA,YAAYA,CAAA,EAAS;EAC5BzC,cAAc,CAAC,MAAM;IACnB,MAAM0C,KAAK,GAAG/C,YAAY;IAC1BA,YAAY,GAAG,EAAE;IACjBD,cAAc,CAACiB,YAAY,CACzBtB,kBAAkB,CAAC,MAAM;MACvB,SAAS;;MACTqD,KAAK,CAACnC,OAAO,CAAC,CAAC,CAACoC,eAAe,EAAEC,WAAW,EAAEC,UAAU,CAAC,KAAK;QAC5D,MAAMtB,MAAM,GAAGoB,eAAe,CAAC,GAAGC,WAAW,CAAC;QAC9C,IAAIC,UAAU,EAAE;UACdX,OAAO,CAACW,UAAU,CAAC,CAACtB,MAAM,CAAC;QAC7B;MACF,CAAC,CAAC;MACFb,cAAc,CAAC,CAAC;IAClB,CAAC,CACH,CAAC;EACH,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASoC,sBAAsBA,CACpClC,OAAiC,EACjC;EACA,OAAO,CAAC,GAAGC,IAAW,KAAK;IACzB,SAAS;;IACTD,OAAO,CAAC,GAAGC,IAAI,CAAC;IAChBH,cAAc,CAAC,CAAC;EAClB,CAAC;AACH","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/types.js b/frontend-admin/node_modules/react-native-worklets/lib/module/types.js deleted file mode 100644 index 97fa9a3b..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/types.js +++ /dev/null @@ -1,5 +0,0 @@ -/* eslint-disable reanimated/use-global-this */ -'use strict'; - -export {}; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/types.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/types.js.map deleted file mode 100644 index 7fb15deb..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"AAAA;AACA,YAAY;;AAAC","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/workletFunction.js b/frontend-admin/node_modules/react-native-worklets/lib/module/workletFunction.js index fd28c788..dca4b1fb 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/workletFunction.js +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/workletFunction.js @@ -2,8 +2,9 @@ /** * This function allows you to determine if a given function is a worklet. It - * only works with Worklets Babel plugin enabled. Unless you are doing something - * with internals of Worklets you shouldn't need to use this function. + * only works with Reanimated Babel plugin enabled. Unless you are doing + * something with internals of Reanimated you shouldn't need to use this + * function. * * ### Note * diff --git a/frontend-admin/node_modules/react-native-worklets/lib/module/workletFunction.js.map b/frontend-admin/node_modules/react-native-worklets/lib/module/workletFunction.js.map index 18883e8d..9a340ad0 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/module/workletFunction.js.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/module/workletFunction.js.map @@ -1 +1 @@ -{"version":3,"names":["isWorkletFunction","value","__workletHash"],"sourceRoot":"../../src","sources":["workletFunction.ts"],"mappings":"AAAA,YAAY;;AAIZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,iBAAiBA,CAG/BC,KAAc,EAA+C;EAC7D,SAAS;;EACT;EACA;EAEA;IACE;IACA,OAAOA,KAAK,KAAK,UAAU,IAC3B,CAAC,CAAEA,KAAK,CAAwCC;EAAa;AAEjE","ignoreList":[]} +{"version":3,"names":["isWorkletFunction","value","__workletHash"],"sourceRoot":"../../src","sources":["workletFunction.ts"],"mappings":"AAAA,YAAY;;AAIZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,iBAAiBA,CAG/BC,KAAc,EAA+C;EAC7D,SAAS;;EACT;EACA;EAEA;IACE;IACA,OAAOA,KAAK,KAAK,UAAU,IAC3B,CAAC,CAAEA,KAAK,CAAwCC;EAAa;AAEjE","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/NativeWorklets.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/NativeWorklets.d.ts index 93f3b676..3bb441ec 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/NativeWorklets.d.ts +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/NativeWorklets.d.ts @@ -1,4 +1,3 @@ import type { IWorkletsModule } from './workletsModuleProxy'; -export type { IWorkletsModule, WorkletsModuleProxy, } from './workletsModuleProxy'; -export declare const WorkletsModule: IWorkletsModule; +export declare function createNativeWorkletsModule(): IWorkletsModule; //# sourceMappingURL=NativeWorklets.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/NativeWorklets.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/NativeWorklets.d.ts.map index d9a0e350..781cf266 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/NativeWorklets.d.ts.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/NativeWorklets.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"NativeWorklets.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/NativeWorklets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,YAAY,EACV,eAAe,EACf,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAE/B,eAAO,MAAM,cAAc,EAAE,eAAuB,CAAC"} \ No newline at end of file +{"version":3,"file":"NativeWorklets.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/NativeWorklets.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,0BAA0B,IAAI,eAAe,CAE5D"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/NativeWorklets.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/NativeWorklets.native.d.ts deleted file mode 100644 index b5f94ff0..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/NativeWorklets.native.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IWorkletsModule } from './workletsModuleProxy'; -export declare const WorkletsModule: IWorkletsModule; -//# sourceMappingURL=NativeWorklets.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/NativeWorklets.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/NativeWorklets.native.d.ts.map deleted file mode 100644 index ba817e90..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/NativeWorklets.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NativeWorklets.native.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/NativeWorklets.native.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAsQ/B,eAAO,MAAM,cAAc,EAAE,eAAsC,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts index 15d57e12..f087529d 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts @@ -1,5 +1,5 @@ -import type { SerializableRef, SynchronizableRef } from '../memory/types'; -import type { WorkletRuntime } from '../types'; +import type { SynchronizableRef } from '../synchronizable'; +import type { SerializableRef, WorkletRuntime } from '../workletTypes'; /** Type of `__workletsModuleProxy` injected with JSI. */ export interface WorkletsModuleProxy { createSerializable(value: TValue, shouldPersistRemote: boolean, nativeStateSource?: object): SerializableRef; @@ -19,8 +19,6 @@ export interface WorkletsModuleProxy { createSerializableInitializer(obj: object): SerializableRef; createSerializableFunction(func: (...args: TArgs) => TReturn): SerializableRef; createSerializableWorklet(worklet: object, shouldPersistRemote: boolean): SerializableRef; - createCustomSerializable(data: SerializableRef, typeId: number): SerializableRef; - registerCustomSerializable(determine: SerializableRef, pack: SerializableRef, unpack: SerializableRef, typeId: number): void; scheduleOnUI(serializable: SerializableRef): void; executeOnUIRuntimeSync(serializable: SerializableRef): TReturn; createWorkletRuntime(name: string, initializer: SerializableRef<() => void>, useDefaultQueue: boolean, customQueue: object | undefined, enableEventLoop: boolean): WorkletRuntime; diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts.map index 9bc72100..b5b76d2d 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"workletsModuleProxy.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/workletsModuleProxy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,CAAC,MAAM,EACvB,KAAK,EAAE,MAAM,EACb,mBAAmB,EAAE,OAAO,EAC5B,iBAAiB,CAAC,EAAE,MAAM,GACzB,eAAe,CAAC,MAAM,CAAC,CAAC;IAE3B,wBAAwB,CAAC,MAAM,EAC7B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,eAAe,CAAC,MAAM,CAAC,CAAC;IAE3B,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAE/D,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAE/D,yBAAyB,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IAEnE,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAElE,2BAA2B,IAAI,eAAe,CAAC,SAAS,CAAC,CAAC;IAE1D,sBAAsB,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IAEhD,iCAAiC,CAC/B,MAAM,SAAS,MAAM,EACrB,MAAM,SAAS,MAAM,EAErB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,eAAe,CAAC,MAAM,CAAC,CAAC;IAE3B,wBAAwB,CAAC,CAAC,SAAS,MAAM,EACvC,GAAG,EAAE,CAAC,EACN,kBAAk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AAO,CAAC;IAE5C,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC3D;AAED,MAAM,MAAM,eAAe,GAAG,mBAAmB,CAAC"} \ No newline at end of file +{"version":3,"file":"workletsModuleProxy.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/workletsModuleProxy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEvE,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,CAAC,MAAM,EACvB,KAAK,EAAE,MAAM,EACb,mBAAmB,EAAE,OAAO,EAC5B,iBAAiB,CAAC,EAAE,MAAM,GACzB,eAAe,CAAC,MAAM,CAAC,CAAC;IAE3B,wBAAwB,CAAC,MAAM,EAC7B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,eAAe,CAAC,MAAM,CAAC,CAAC;IAE3B,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAE/D,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAE/D,yBAAyB,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IAEnE,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAElE,2BAA2B,IAAI,eAAe,CAAC,SAAS,CAAC,CAAC;IAE1D,sBAAsB,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IAEhD,iCAAiC,CAC/B,MAAM,SAAS,MAAM,EACrB,MAAM,SAAS,MAAM,EAErB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,eAAe,CAAC,MAAM,CAAC,CAAC;IA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C,MAAM,IAAI,CAAC,EACxC,eAAe,EAAE,OAAO,EACxB,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,eAAe,EAAE,OAAO,GACvB,cAAc,CAAC;IAElB,iBAAiB,CAAC,MAAM,EACtB,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,GAC/B,IAAI,CAAC;IAER,oBAAoB,CAClB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,IAAI,CAAC;IAER,oBAAoB,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAEvE,sBAAsB,CAAC,MAAM,EAC3B,iBAAiB,EAAE,iBAAiB,CAAC,MAAM,CAAC,GAC3C,MAAM,CAAC;IAEV,yBAAyB,CAAC,MAAM,EAC9B,iBAAiB,EAAE,iBAAiB,CAAC,MAAM,CAAC,GAC3C,MAAM,CAAC;IAEV,yBAAyB,CAAC,MAAM,EAC9B,iBAAiB,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAC5C,KAAK,EAAE,eAAe,CAAC,MAAM,CAAC,GAC7B,IAAI,CAAC;IAER,kBAAkB,CAAC,MAAM,EACvB,iBAAiB,EAAE,iBAAiB,CAAC,MAAM,CAAC,GAC3C,IAAI,CAAC;IAER,oBAAoB,CAAC,MAAM,EACzB,iBAAiB,EAAE,iBAAiB,CAAC,MAAM,CAAC,GAC3C,IAAI,CAAC;IAER,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAE5C,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC3D;AAED,MAAM,MAAM,eAAe,GAAG,mBAAmB,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/callGuard.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/callGuard.native.d.ts deleted file mode 100644 index 47624869..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/callGuard.native.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** Used only with debug builds. */ -export declare function callGuardDEV(fn: (...args: Args) => ReturnValue, ...args: Args): ReturnValue | void; -export declare function setupCallGuard(): void; -//# sourceMappingURL=callGuard.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/callGuard.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/callGuard.native.d.ts.map deleted file mode 100644 index ffb81844..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/callGuard.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"callGuard.native.d.ts","sourceRoot":"","sources":["../../src/callGuard.native.ts"],"names":[],"mappings":"AAIA,mCAAmC;AACnC,wBAAgB,YAAY,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EAC9D,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,EAClC,GAAG,IAAI,EAAE,IAAI,GACZ,WAAW,GAAG,IAAI,CAiBpB;AAED,wBAAgB,cAAc,SAK7B"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/WorkletsError.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/WorkletsError.d.ts deleted file mode 100644 index c520f12d..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/WorkletsError.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IWorkletsErrorConstructor } from './types'; -export declare const WorkletsError: IWorkletsErrorConstructor; -//# sourceMappingURL=WorkletsError.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/WorkletsError.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/WorkletsError.d.ts.map deleted file mode 100644 index aa8e3e1f..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/WorkletsError.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"WorkletsError.d.ts","sourceRoot":"","sources":["../../../src/debug/WorkletsError.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,yBAAyB,EAE1B,MAAM,SAAS,CAAC;AAWjB,eAAO,MAAM,aAAa,EACI,yBAAyB,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/WorkletsError.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/WorkletsError.native.d.ts deleted file mode 100644 index 40ba38f5..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/WorkletsError.native.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IWorkletsErrorConstructor } from './types'; -/** - * Registers WorkletsError in the global scope. Register only for Worklet - * runtimes. - */ -export declare function registerWorkletsError(): void; -export declare const WorkletsError: IWorkletsErrorConstructor; -//# sourceMappingURL=WorkletsError.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/WorkletsError.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/WorkletsError.native.d.ts.map deleted file mode 100644 index 55fe36e7..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/WorkletsError.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"WorkletsError.native.d.ts","sourceRoot":"","sources":["../../../src/debug/WorkletsError.native.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,yBAAyB,EAE1B,MAAM,SAAS,CAAC;AAYjB;;;GAGG;AACH,wBAAgB,qBAAqB,SAMpC;AAED,eAAO,MAAM,aAAa,EACI,yBAAyB,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/checkCppVersion.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/checkCppVersion.d.ts deleted file mode 100644 index c469aa94..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/checkCppVersion.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare function checkCppVersion(): void; -export declare function matchVersion(version1: string, version2: string): boolean; -//# sourceMappingURL=checkCppVersion.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/checkCppVersion.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/checkCppVersion.d.ts.map deleted file mode 100644 index ad34fd1c..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/checkCppVersion.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checkCppVersion.d.ts","sourceRoot":"","sources":["../../../src/debug/checkCppVersion.ts"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,SAgB9B;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAU9D"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/errors.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/errors.native.d.ts deleted file mode 100644 index c7b6b4dd..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/errors.native.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { WorkletStackDetails } from '../types'; -export declare function registerWorkletStackDetails(hash: number, stackDetails: WorkletStackDetails): void; -export interface RNError extends Error { - jsEngine: string; -} -/** - * Remote error is an error coming from a Worklet Runtime that we bubble up to - * the RN Runtime. - */ -export declare function reportFatalRemoteError({ message, stack, name, jsEngine }: RNError, force: boolean): void; -/** - * Registers `reportFatalRemoteError` function in global scope to allow to - * invoke it from C++. - */ -export declare function registerReportFatalRemoteError(): void; -//# sourceMappingURL=errors.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/errors.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/errors.native.d.ts.map deleted file mode 100644 index 7d68d8e1..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/errors.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.native.d.ts","sourceRoot":"","sources":["../../../src/debug/errors.native.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAKpD,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,mBAAmB,QAGlC;AAoCD,MAAM,WAAW,OAAQ,SAAQ,KAAK;IACpC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAC3C,KAAK,EAAE,OAAO,GACb,IAAI,CAYN;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,SAE7C"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/jsVersion.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/jsVersion.d.ts deleted file mode 100644 index fab3e34b..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/jsVersion.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * We hardcode the version of Worklets here in order to compare it with the - * version used to build the native part of the library in runtime. Remember to - * keep this in sync with the version declared in `package.json` - */ -export declare const jsVersion = "0.7.2"; -//# sourceMappingURL=jsVersion.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/jsVersion.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/jsVersion.d.ts.map deleted file mode 100644 index 960e27be..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/jsVersion.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jsVersion.d.ts","sourceRoot":"","sources":["../../../src/debug/jsVersion.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,SAAS,UAAU,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/logger.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/logger.d.ts deleted file mode 100644 index c8ff73d7..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/logger.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const logger: { - warn(message: string): void; - error(message: string): void; -}; -//# sourceMappingURL=logger.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/logger.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/logger.d.ts.map deleted file mode 100644 index e632e746..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/logger.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/debug/logger.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM;kBACH,MAAM;mBAGL,MAAM;CAGtB,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/types.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/types.d.ts deleted file mode 100644 index fd8dfa2a..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/types.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type WorkletsError = Error & { - name: 'Worklets'; -}; -export interface IWorkletsErrorConstructor extends Error { - new (message?: string): WorkletsError; - (message?: string): WorkletsError; - readonly prototype: WorkletsError; -} -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/types.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/types.d.ts.map deleted file mode 100644 index 760f0baf..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/debug/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/debug/types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAEzD,MAAM,WAAW,yBAA0B,SAAQ,KAAK;IACtD,KAAK,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IACtC,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;CACnC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/deprecated.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/deprecated.d.ts index 811e1ff0..d94a6fb1 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/deprecated.d.ts +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/deprecated.d.ts @@ -1,5 +1,5 @@ -import { isSerializableRef, makeShareable, makeShareableCloneOnUIRecursive } from './memory/serializable'; -import type { SerializableRef } from './memory/types'; +import { isSerializableRef, makeShareable, makeShareableCloneOnUIRecursive } from './serializable'; +import type { SerializableRef } from './workletTypes'; /** @deprecated Use {@link SerializableRef} instead. */ export type ShareableRef = SerializableRef; export { makeShareable, makeShareableCloneOnUIRecursive }; @@ -11,6 +11,9 @@ export declare const makeShareableCloneRecursive: MakeShareableClone; export declare const isShareableRef: typeof isSerializableRef; /** @deprecated Use {@link serializableMappingCache} instead. */ export declare const shareableMappingCache: { + set(): void; + get(): null; +} | { set(serializable: object, serializableRef?: SerializableRef): void; get: (key: object) => symbol | SerializableRef | undefined; }; diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/deprecated.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/deprecated.d.ts.map index e6b5d9f2..4e78f5f6 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/deprecated.d.ts.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/deprecated.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"deprecated.d.ts","sourceRoot":"","sources":["../../src/deprecated.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,iBAAiB,EACjB,aAAa,EACb,+BAA+B,EAChC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,uDAAuD;AACvD,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,+BAA+B,EAAE,CAAC;AAE1D,gEAAgE;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,EACjC,KAAK,EAAE,CAAC,EACR,mBAAmB,CAAC,EAAE,OAAO,EAC7B,KAAK,CAAC,EAAE,MAAM,KACX,YAAY,CAAC,CAAC,CAAC,CAAC;AAErB,0DAA0D;AAC1D,eAAO,MAAM,2BAA2B,EAAE,kBACtB,CAAC;AAErB,yDAAyD;AACzD,eAAO,MAAM,cAAc,0BAAoB,CAAC;AAEhD,gEAAgE;AAChE,eAAO,MAAM,qBAAqB;;;CAA2B,CAAC"} \ No newline at end of file +{"version":3,"file":"deprecated.d.ts","sourceRoot":"","sources":["../../src/deprecated.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,iBAAiB,EACjB,aAAa,EACb,+BAA+B,EAChC,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,uDAAuD;AACvD,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,+BAA+B,EAAE,CAAC;AAE1D,gEAAgE;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,EACjC,KAAK,EAAE,CAAC,EACR,mBAAmB,CAAC,EAAE,OAAO,EAC7B,KAAK,CAAC,EAAE,MAAM,KACX,YAAY,CAAC,CAAC,CAAC,CAAC;AAErB,0DAA0D;AAC1D,eAAO,MAAM,2BAA2B,EAAE,kBACtB,CAAC;AAErB,yDAAyD;AACzD,eAAO,MAAM,cAAc,0BAAoB,CAAC;AAEhD,gEAAgE;AAChE,eAAO,MAAM,qBAAqB;;;;;;CAA2B,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/featureFlags.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/featureFlags.d.ts deleted file mode 100644 index 219ba51b..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/featureFlags.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { DynamicFlagName, StaticFeatureFlagsSchema } from './types'; -export declare function getStaticFeatureFlag(_name: keyof StaticFeatureFlagsSchema): boolean; -export declare function setDynamicFeatureFlag(_name: DynamicFlagName, _value: boolean): void; -export declare function getDynamicFeatureFlag(_name: DynamicFlagName): boolean; -//# sourceMappingURL=featureFlags.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/featureFlags.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/featureFlags.d.ts.map deleted file mode 100644 index 23c4a9bf..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/featureFlags.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"featureFlags.d.ts","sourceRoot":"","sources":["../../../src/featureFlags/featureFlags.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEzE,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,wBAAwB,GACpC,OAAO,CAET;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,OAAO,GACd,IAAI,CAEN;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAErE"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/featureFlags.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/featureFlags.native.d.ts deleted file mode 100644 index 83b83a43..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/featureFlags.native.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DynamicFlagName, DynamicFlagsType, StaticFeatureFlagsSchema } from './types'; -export declare const DynamicFlags: DynamicFlagsType; -export declare function setDynamicFeatureFlag(name: DynamicFlagName, value: boolean): void; -export declare function getDynamicFeatureFlag(name: DynamicFlagName): boolean; -export declare function getStaticFeatureFlag(name: keyof StaticFeatureFlagsSchema): boolean; -//# sourceMappingURL=featureFlags.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/featureFlags.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/featureFlags.native.d.ts.map deleted file mode 100644 index 2c94b500..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/featureFlags.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"featureFlags.native.d.ts","sourceRoot":"","sources":["../../../src/featureFlags/featureFlags.native.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,YAAY,EAAE,gBAiC1B,CAAC;AAIF,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,OAAO,GACb,IAAI,CAEN;AAGD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAEpE;AAID,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,wBAAwB,GACnC,OAAO,CAOT"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/types.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/types.d.ts deleted file mode 100644 index 20a9de16..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/types.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -export type DynamicFlagsType = { - EXAMPLE_DYNAMIC_FLAG: boolean; - init(): void; - setFlag(name: DynamicFlagName, value: boolean): void; - getFlag(name: DynamicFlagName): boolean; -}; -export type DynamicFlagName = keyof Omit, 'init'>; -/** - * This constant is needed for typechecking and preserving static typechecks in - * generated .d.ts files. Without it, the static flags resolve to an object - * without specific keys. - */ -export declare const DefaultStaticFeatureFlags: { - readonly RUNTIME_TEST_FLAG: false; - readonly IOS_DYNAMIC_FRAMERATE_ENABLED: false; -}; -export type StaticFeatureFlagsSchema = { - -readonly [K in keyof typeof DefaultStaticFeatureFlags]: boolean; -}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/types.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/types.d.ts.map deleted file mode 100644 index 6006272a..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/featureFlags/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/featureFlags/types.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,IAAI,IAAI,IAAI,CAAC;IACb,OAAO,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACrD,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,MAAM,IAAI,CACtC,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,SAAS,CAAC,EAC7C,MAAM,CACP,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;CAGY,CAAC;AAEnD,MAAM,MAAM,wBAAwB,GAAG;IACrC,CAAC,UAAU,CAAC,IAAI,MAAM,OAAO,yBAAyB,GAAG,OAAO;CACjE,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/index.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/index.d.ts index 44d9dcde..ea94cb30 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/index.d.ts +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/index.d.ts @@ -1,15 +1,17 @@ -export { isShareableRef, makeShareable, type MakeShareableClone, makeShareableCloneOnUIRecursive, makeShareableCloneRecursive, shareableMappingCache, type ShareableRef, } from './deprecated'; -export { getDynamicFeatureFlag, getStaticFeatureFlag, setDynamicFeatureFlag, } from './featureFlags/featureFlags'; -export { isSynchronizable } from './memory/isSynchronizable'; -export { createSerializable, isSerializableRef, registerCustomSerializable, } from './memory/serializable'; -export { serializableMappingCache } from './memory/serializableMappingCache'; -export { createSynchronizable } from './memory/synchronizable'; -export type { RegistrationData, SerializableRef, Synchronizable, SynchronizableRef, } from './memory/types'; +import './publicGlobals'; +export type { MakeShareableClone, ShareableRef } from './deprecated'; +export { isShareableRef, makeShareable, makeShareableCloneOnUIRecursive, makeShareableCloneRecursive, shareableMappingCache, } from './deprecated'; +export { getStaticFeatureFlag, setDynamicFeatureFlag } from './featureFlags'; +export { isSynchronizable } from './isSynchronizable'; export { getRuntimeKind, RuntimeKind } from './runtimeKind'; -export { createWorkletRuntime, runOnRuntime, scheduleOnRuntime, } from './runtimes'; +export { createWorkletRuntime, runOnRuntime } from './runtimes'; +export { createSerializable, isSerializableRef } from './serializable'; +export { serializableMappingCache } from './serializableMappingCache'; +export type { Synchronizable } from './synchronizable'; +export { createSynchronizable } from './synchronizable'; export { callMicrotasks, executeOnUIRuntimeSync, runOnJS, runOnUI, runOnUIAsync, runOnUISync, scheduleOnRN, scheduleOnUI, unstable_eventLoopTask, } from './threads'; -export type { WorkletFunction, WorkletRuntime, WorkletStackDetails, } from './types'; export { isWorkletFunction } from './workletFunction'; -export { WorkletsModule } from './WorkletsModule/NativeWorklets'; -export type { IWorkletsModule, WorkletsModuleProxy, } from './WorkletsModule/workletsModuleProxy'; +export type { IWorkletsModule, WorkletsModuleProxy } from './WorkletsModule'; +export { WorkletsModule } from './WorkletsModule'; +export type { SerializableRef, WorkletFunction, WorkletRuntime, WorkletStackDetails, } from './workletTypes'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/index.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/index.d.ts.map index 776494ff..ab805a0c 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/index.d.ts.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,cAAc,EACd,aAAa,EACb,KAAK,kBAAkB,EACvB,+BAA+B,EAC/B,2BAA2B,EAC3B,qBAAqB,EACrB,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,OAAO,EACP,OAAO,EACP,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EAEZ,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,eAAe,EACf,cAAc,EACd,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,YAAY,EACV,eAAe,EACf,mBAAmB,GACpB,MAAM,sCAAsC,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,iBAAiB,CAAC;AAOzB,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EACL,cAAc,EACd,aAAa,EACb,+BAA+B,EAC/B,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,OAAO,EACP,OAAO,EACP,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EAEZ,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EACV,eAAe,EACf,eAAe,EACf,cAAc,EACd,mBAAmB,GACpB,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/initializers.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/initializers.d.ts deleted file mode 100644 index d308ca63..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/initializers.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function init(): void; -//# sourceMappingURL=initializers.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/initializers.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/initializers.d.ts.map deleted file mode 100644 index bc65b110..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/initializers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"initializers.d.ts","sourceRoot":"","sources":["../../../src/initializers/initializers.ts"],"names":[],"mappings":"AAMA,wBAAgB,IAAI,SAcnB"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/initializers.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/initializers.native.d.ts deleted file mode 100644 index 35b45ff1..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/initializers.native.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Currently there seems to be a bug in the JSI layer which causes a crash when - * we try to copy some of the console methods, i.e. `clear` or `dirxml`. - * - * The crash happens only in React Native 0.75. It's not reproducible in neither - * 0.76 nor 0.74. It also happens only in the configuration of a debug app and - * production bundle. - * - * I haven't yet discovered what exactly causes the crash. It's tied to the - * console methods sometimes being `HostFunction`s. Therefore, as a workaround - * we don't copy the methods as they are in the original console object, we copy - * JavaScript wrappers instead. - */ -export declare function getMemorySafeCapturableConsole(): typeof console; -export declare function setupConsole(boundCapturableConsole: typeof console): void; -export declare function init(): void; -//# sourceMappingURL=initializers.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/initializers.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/initializers.native.d.ts.map deleted file mode 100644 index ea14f741..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/initializers.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"initializers.native.d.ts","sourceRoot":"","sources":["../../../src/initializers/initializers.native.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;GAYG;AACH,wBAAgB,8BAA8B,IAAI,OAAO,OAAO,CA8B/D;AAED,wBAAgB,YAAY,CAAC,sBAAsB,EAAE,OAAO,OAAO,QAWlE;AAID,wBAAgB,IAAI,SAcnB"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/workletRuntimeEntry.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/workletRuntimeEntry.d.ts deleted file mode 100644 index fe4a7b12..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/workletRuntimeEntry.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function bundleModeInit(): void; -//# sourceMappingURL=workletRuntimeEntry.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/workletRuntimeEntry.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/workletRuntimeEntry.d.ts.map deleted file mode 100644 index 3205af30..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/workletRuntimeEntry.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"workletRuntimeEntry.d.ts","sourceRoot":"","sources":["../../../src/initializers/workletRuntimeEntry.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,SAE7B"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/workletRuntimeEntry.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/workletRuntimeEntry.native.d.ts deleted file mode 100644 index 604900da..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/workletRuntimeEntry.native.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * This function is an entry point for Worklet Runtimes. We can use it to setup - * necessary tools, like the ValueUnpacker. - * - * We must throw an error at the end of this function to prevent the bundle to - * continue executing. This is because the next module to be ran would be the - * React Native one, and it would break the Worklet Runtime if initialized. The - * error is caught in C++ code. - * - * This function has no effect on the RN Runtime beside setting the - * `_WORKLETS_BUNDLE_MODE` flag. - */ -export declare function bundleModeInit(): void; -//# sourceMappingURL=workletRuntimeEntry.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/workletRuntimeEntry.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/workletRuntimeEntry.native.d.ts.map deleted file mode 100644 index 81295a99..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/initializers/workletRuntimeEntry.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"workletRuntimeEntry.native.d.ts","sourceRoot":"","sources":["../../../src/initializers/workletRuntimeEntry.native.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,SAkB7B"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/bundleUnpacker.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/bundleUnpacker.native.d.ts deleted file mode 100644 index b7ce0a1c..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/bundleUnpacker.native.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WorkletFunction } from '../types'; -export declare function bundleValueUnpacker(objectToUnpack: ObjectToUnpack, category?: string, remoteFunctionName?: string): unknown; -interface ObjectToUnpack extends WorkletFunction { - _recur: unknown; -} -export {}; -//# sourceMappingURL=bundleUnpacker.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/bundleUnpacker.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/bundleUnpacker.native.d.ts.map deleted file mode 100644 index c8fa0e63..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/bundleUnpacker.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundleUnpacker.native.d.ts","sourceRoot":"","sources":["../../../src/memory/bundleUnpacker.native.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhE,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,cAAc,EAC9B,QAAQ,CAAC,EAAE,MAAM,EACjB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CA4BT;AAiCD,UAAU,cAAe,SAAQ,eAAe;IAC9C,MAAM,EAAE,OAAO,CAAC;CACjB"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/customSerializableUnpacker.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/customSerializableUnpacker.native.d.ts deleted file mode 100644 index cb4143b7..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/customSerializableUnpacker.native.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare function __installUnpacker(): void; -export type CustomSerializableUnpacker = (object: unknown, typeId: number) => unknown; -//# sourceMappingURL=customSerializableUnpacker.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/customSerializableUnpacker.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/customSerializableUnpacker.native.d.ts.map deleted file mode 100644 index 1d8d3e99..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/customSerializableUnpacker.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"customSerializableUnpacker.native.d.ts","sourceRoot":"","sources":["../../../src/memory/customSerializableUnpacker.native.ts"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,SAoBhC;AAED,MAAM,MAAM,0BAA0B,GAAG,CACvC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,KACX,OAAO,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/isSynchronizable.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/isSynchronizable.d.ts deleted file mode 100644 index 59f8a506..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/isSynchronizable.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Synchronizable } from './types'; -export declare function isSynchronizable(_value: unknown): _value is Synchronizable; -//# sourceMappingURL=isSynchronizable.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/isSynchronizable.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/isSynchronizable.d.ts.map deleted file mode 100644 index 9a688da7..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/isSynchronizable.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"isSynchronizable.d.ts","sourceRoot":"","sources":["../../../src/memory/isSynchronizable.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,gBAAgB,CAAC,MAAM,EACrC,MAAM,EAAE,OAAO,GACd,MAAM,IAAI,cAAc,CAAC,MAAM,CAAC,CAElC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/isSynchronizable.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/isSynchronizable.native.d.ts deleted file mode 100644 index 80f80156..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/isSynchronizable.native.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Synchronizable } from './types'; -export declare function isSynchronizable(value: unknown): value is Synchronizable; -//# sourceMappingURL=isSynchronizable.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/isSynchronizable.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/isSynchronizable.native.d.ts.map deleted file mode 100644 index cd914fb2..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/isSynchronizable.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"isSynchronizable.native.d.ts","sourceRoot":"","sources":["../../../src/memory/isSynchronizable.native.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,gBAAgB,CAAC,MAAM,EACrC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,cAAc,CAAC,MAAM,CAAC,CAQjC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializable.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializable.d.ts deleted file mode 100644 index 3d62eb28..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializable.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { FlatSerializableRef, RegistrationData, SerializableRef } from './types'; -export declare function isSerializableRef(value: unknown): value is SerializableRef; -export declare function createSerializable(value: TValue): SerializableRef; -export declare function makeShareableCloneOnUIRecursive(value: TValue): FlatSerializableRef; -export declare function makeShareable(value: TValue): TValue; -export declare function registerCustomSerializable(_registrationData: RegistrationData): void; -//# sourceMappingURL=serializable.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializable.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializable.d.ts.map deleted file mode 100644 index 318f96b3..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializable.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"serializable.d.ts","sourceRoot":"","sources":["../../../src/memory/serializable.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,iBAAiB,CAAC,MAAM,GAAG,OAAO,EAChD,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,eAAe,CAAC,MAAM,CAAC,CAElC;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EACvC,KAAK,EAAE,MAAM,GACZ,eAAe,CAAC,MAAM,CAAC,CAEzB;AAED,wBAAgB,+BAA+B,CAAC,MAAM,EACpD,KAAK,EAAE,MAAM,GACZ,mBAAmB,CAAC,MAAM,CAAC,CAE7B;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,0BAA0B,CACxC,MAAM,SAAS,MAAM,EACrB,OAAO,SAAS,MAAM,EACtB,iBAAiB,EAAE,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,QAErD"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializable.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializable.native.d.ts deleted file mode 100644 index 9bd16e6d..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializable.native.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { FlatSerializableRef, RegistrationData, SerializableRef } from './types'; -export declare function isSerializableRef(value: unknown): value is SerializableRef; -export declare function createSerializable(value: TValue, shouldPersistRemote?: boolean, depth?: number): SerializableRef; -export declare namespace createSerializable { - var __bundleData: { - imported: string; - source: number; - }; -} -/** - * `registerCustomSerializable` lets you register your own pre-serialization and - * post-deserialization logic. This is necessary for objects with prototypes - * different than just `Object.prototype` or some other built-in prototypes like - * `Map` etc. Worklets can't handle such objects by default to convert into - * [Serializables](https://docs.swmansion.com/react-native-worklets/docs/memory/serializable) - * hence you need to register them as **Custom Serializables**. This way you can - * tell Worklets how to transfer your custom data structures between different - * Runtimes without manually serializing and deserializing them every time. - * - * @param registrationData - The registration data for the custom serializable - - * {@link RegistrationData} - * @see https://docs.swmansion.com/react-native-worklets/docs/memory/registerCustomSerializable/ - */ -export declare function registerCustomSerializable(registrationData: RegistrationData): void; -declare function makeShareableCloneOnUIRecursiveLEGACY(value: TValue): FlatSerializableRef; -/** @deprecated This function is no longer supported. */ -export declare const makeShareableCloneOnUIRecursive: typeof makeShareableCloneOnUIRecursiveLEGACY; -/** - * This function creates a value on UI with persistent state - changes to it on - * the UI thread will be seen by all worklets. Use it when you want to create a - * value that is read and written only on the UI thread. - * - * @deprecated This function is no longer supported. - */ -export declare function makeShareable(value: TValue): TValue; -export {}; -//# sourceMappingURL=serializable.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializable.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializable.native.d.ts.map deleted file mode 100644 index d46acae0..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializable.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"serializable.native.d.ts","sourceRoot":"","sources":["../../../src/memory/serializable.native.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EAGhB,MAAM,SAAS,CAAC;AAajB,wBAAgB,iBAAiB,CAAC,MAAM,GAAG,OAAO,EAChD,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,eAAe,CAAC,MAAM,CAAC,CAQlC;AAqFD,wBAAgB,kBAAkB,CAAC,MAAM,EACvC,KAAK,EAAE,MAAM,EACb,mBAAmB,UAAQ,EAC3B,KAAK,SAAI,GACR,eAAe,CAAC,MAAM,CAAC,CAyGzB;yBA7Ge,kBAAkB;;;;;;AA6HlC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,SAAS,MAAM,EACrB,OAAO,SAAS,MAAM,EACtB,gBAAgB,EAAE,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,QA+BpD;AAkeD,iBAAS,qCAAqC,CAAC,MAAM,EACnD,KAAK,EAAE,MAAM,GACZ,mBAAmB,CAAC,MAAM,CAAC,CAkF7B;AAED,wDAAwD;AACxD,eAAO,MAAM,+BAA+B,EAIvC,OAAO,qCAAqC,CAAC;AAElD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,SAAS,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAY1E"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializableMappingCache.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializableMappingCache.d.ts deleted file mode 100644 index 3a74fad7..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializableMappingCache.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { SerializableRef } from './types'; -export declare const serializableMappingCache: { - set(_serializable: object, _serializableRef?: SerializableRef): void; - get(_key: object): object | symbol | SerializableRef; -}; -//# sourceMappingURL=serializableMappingCache.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializableMappingCache.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializableMappingCache.d.ts.map deleted file mode 100644 index 0c555d64..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializableMappingCache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"serializableMappingCache.d.ts","sourceRoot":"","sources":["../../../src/memory/serializableMappingCache.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,wBAAwB;uBAChB,MAAM,qBAAqB,eAAe,GAAG,IAAI;cAG1D,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,eAAe;CAGrD,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializableMappingCache.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializableMappingCache.native.d.ts deleted file mode 100644 index 9ba11b94..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializableMappingCache.native.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { SerializableRef } from './types'; -/** - * This symbol is used to represent a mapping from the value to itself. - * - * It's used to prevent converting a serializable that's already converted - for - * example a Shared Value that's in worklet's closure. - */ -export declare const serializableMappingFlag: unique symbol; -export declare const serializableMappingCache: { - set(serializable: object, serializableRef?: SerializableRef): void; - get: (key: object) => symbol | SerializableRef | undefined; -}; -//# sourceMappingURL=serializableMappingCache.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializableMappingCache.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializableMappingCache.native.d.ts.map deleted file mode 100644 index a5b009dc..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/serializableMappingCache.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"serializableMappingCache.native.d.ts","sourceRoot":"","sources":["../../../src/memory/serializableMappingCache.native.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,eAA8B,CAAC;AAenE,eAAO,MAAM,wBAAwB;sBACjB,MAAM,oBAAoB,eAAe,GAAG,IAAI;;CAInE,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizable.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizable.d.ts deleted file mode 100644 index 840333e8..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizable.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Synchronizable } from './types'; -export declare function createSynchronizable(_value: TValue): Synchronizable; -//# sourceMappingURL=synchronizable.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizable.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizable.d.ts.map deleted file mode 100644 index 56581c4a..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizable.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"synchronizable.d.ts","sourceRoot":"","sources":["../../../src/memory/synchronizable.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,oBAAoB,CAAC,MAAM,GAAG,OAAO,EACnD,MAAM,EAAE,MAAM,GACb,cAAc,CAAC,MAAM,CAAC,CAExB"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizable.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizable.native.d.ts deleted file mode 100644 index 6b5ca299..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizable.native.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Synchronizable } from './types'; -export declare function createSynchronizable(initialValue: TValue): Synchronizable; -//# sourceMappingURL=synchronizable.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizable.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizable.native.d.ts.map deleted file mode 100644 index 3b5ea8ce..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizable.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"synchronizable.native.d.ts","sourceRoot":"","sources":["../../../src/memory/synchronizable.native.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,oBAAoB,CAAC,MAAM,GAAG,OAAO,EACnD,YAAY,EAAE,MAAM,GACnB,cAAc,CAAC,MAAM,CAAC,CAQxB"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizableUnpacker.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizableUnpacker.native.d.ts deleted file mode 100644 index b42d5da9..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizableUnpacker.native.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { type Synchronizable, type SynchronizableRef } from './types'; -export declare function __installUnpacker(): void; -export type SynchronizableUnpacker = (synchronizableRef: SynchronizableRef) => Synchronizable; -//# sourceMappingURL=synchronizableUnpacker.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizableUnpacker.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizableUnpacker.native.d.ts.map deleted file mode 100644 index b9bfd72e..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/synchronizableUnpacker.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"synchronizableUnpacker.native.d.ts","sourceRoot":"","sources":["../../../src/memory/synchronizableUnpacker.native.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEtE,wBAAgB,iBAAiB,SAyDhC;AAED,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAC1C,iBAAiB,EAAE,iBAAiB,CAAC,MAAM,CAAC,KACzC,cAAc,CAAC,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/types.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/types.d.ts deleted file mode 100644 index 2ddfff3b..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/types.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -/** - * The below type is used for HostObjects returned by the JSI API that don't - * have any accessible fields or methods but can carry data that is accessed - * from the c++ side. We add a field to the type to make it possible for - * typescript to recognize which JSI methods accept those types as arguments and - * to be able to correctly type check other methods that may use them. However, - * this field is not actually defined nor should be used for anything else as - * assigning any data to those objects will throw an error. - */ -export type SerializableRef = { - __serializableRef: true; - __nativeStateSerializableJSRef: TValue; -}; -export type FlatSerializableRef = TValue extends SerializableRef ? SerializableRef : SerializableRef; -export type SynchronizableRef = { - __synchronizableRef: true; - __nativeStateSynchronizableJSRef: TValue; -}; -export type Synchronizable = SerializableRef & SynchronizableRef & { - __synchronizableRef: true; - getDirty(): TValue; - getBlocking(): TValue; - setBlocking(value: TValue | ((prev: TValue) => TValue)): void; - lock(): void; - unlock(): void; -}; -/** - * Registration data for - * [registerCustomSerializable](https://docs.swmansion.com/react-native-reanimated/docs/memory/registerCustomSerializable) - * function. - */ -export type RegistrationData = { - /** - * A unique name for the Custom Serializable. It's used to prevent duplicate - * registrations of the same Custom Serializable. You will get warned if you - * attempt to register a Custom Serializable with a name that has already been - * used. - */ - name: string; - /** - * A worklet that checks whether a given JavaScript value is of the type - * handled by this Custom Serializable. - */ - determine: (value: object) => value is TValue; - /** - * A worklet that packs the JavaScript value of type `TValue` into a value - * that can be serialized by default as Serializable. The function must return - * a [supported type for - * Serialization](https://docs.swmansion.com/react-native-reanimated/docs/memory/Serializable#supported-types). - */ - pack: (value: TValue) => TPacked; - /** - * A worklet that unpacks the packed value, after it's been deserialized from - * it's packed form, back into the JavaScript value of type `TValue`. - */ - unpack: (value: TPacked) => TValue; -}; -export type SerializationData = Omit, 'name'> & { - /** Only defined on the RN Runtime. */ - name?: string; -}; -export type CustomSerializationRegistry = SerializationData[]; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/types.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/types.d.ts.map deleted file mode 100644 index e5e70550..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/memory/types.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,CAAC,MAAM,GAAG,OAAO,IAAI;IAC9C,iBAAiB,EAAE,IAAI,CAAC;IACxB,8BAA8B,EAAE,MAAM,CAAC;CACxC,CAAC;AAIF,MAAM,MAAM,mBAAmB,CAAC,MAAM,IACpC,MAAM,SAAS,eAAe,CAAC,MAAM,UAAU,CAAC,GAC5C,eAAe,CAAC,UAAU,CAAC,GAC3B,eAAe,CAAC,MAAM,CAAC,CAAC;AAE9B,MAAM,MAAM,iBAAiB,CAAC,MAAM,GAAG,OAAO,IAAI;IAChD,mBAAmB,EAAE,IAAI,CAAC;IAC1B,gCAAgC,EAAE,MAAM,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,MAAM,GAAG,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,GACpE,iBAAiB,CAAC,MAAM,CAAC,GAAG;IAC1B,mBAAmB,EAAE,IAAI,CAAC;IAC1B,QAAQ,IAAI,MAAM,CAAC;IACnB,WAAW,IAAI,MAAM,CAAC;IACtB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAI,CAAC;IAC9D,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,IAAI,IAAI,CAAC;CAChB,CAAC;AAEJ;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,MAAM,SAAS,MAAM,EAAE,OAAO,GAAG,OAAO,IAAI;IACvE;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,KAAK,IAAI,MAAM,CAAC;IAC9C;;;;;OAKG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACjC;;;OAGG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,MAAM,SAAS,MAAM,EAAE,OAAO,GAAG,OAAO,IAAI,IAAI,CAC5E,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,MAAM,CACP,GAAG;IACF,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/valueUnpacker.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/valueUnpacker.native.d.ts deleted file mode 100644 index 2b952616..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/valueUnpacker.native.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare global { - var evalWithSourceMap: ((js: string, sourceURL: string, sourceMap: string) => () => unknown) | undefined; - var evalWithSourceUrl: ((js: string, sourceURL: string) => () => unknown) | undefined; -} -export {}; -//# sourceMappingURL=valueUnpacker.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/valueUnpacker.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/valueUnpacker.native.d.ts.map deleted file mode 100644 index 91146715..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/memory/valueUnpacker.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"valueUnpacker.native.d.ts","sourceRoot":"","sources":["../../../src/memory/valueUnpacker.native.ts"],"names":[],"mappings":"AAIA,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,iBAAiB,EACjB,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,OAAO,CAAC,GACrE,SAAS,CAAC;IACd,IAAI,iBAAiB,EACjB,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,OAAO,CAAC,GAClD,SAAS,CAAC;CACf"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/mock.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/mock.d.ts deleted file mode 100644 index 9ff4e2fe..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/mock.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=mock.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/mock.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/mock.d.ts.map deleted file mode 100644 index 3e18c8ed..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/mock.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/mock.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/platformChecker.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/platformChecker.d.ts deleted file mode 100644 index 0ca7e07e..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/platformChecker.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const IS_JEST: boolean; -export declare const IS_WEB: boolean; -export declare const IS_WINDOWS: boolean; -export declare const SHOULD_BE_USE_WEB: boolean; -//# sourceMappingURL=platformChecker.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/platformChecker.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/platformChecker.d.ts.map deleted file mode 100644 index 61f9b054..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/platformChecker.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"platformChecker.d.ts","sourceRoot":"","sources":["../../src/platformChecker.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,EAAE,OAAsC,CAAC;AAC7D,eAAO,MAAM,MAAM,EAAE,OAA+B,CAAC;AACrD,eAAO,MAAM,UAAU,EAAE,OAAmC,CAAC;AAC7D,eAAO,MAAM,iBAAiB,EAAE,OAAyC,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/platformChecker.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/platformChecker.native.d.ts deleted file mode 100644 index 4715199f..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/platformChecker.native.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const IS_JEST = false; -//# sourceMappingURL=platformChecker.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/platformChecker.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/platformChecker.native.d.ts.map deleted file mode 100644 index 402f912c..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/platformChecker.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"platformChecker.native.d.ts","sourceRoot":"","sources":["../../src/platformChecker.native.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,QAAQ,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/runtimes.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/runtimes.d.ts index 61822537..698e851a 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/runtimes.d.ts +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/runtimes.d.ts @@ -1,6 +1,77 @@ -import type { WorkletFunction, WorkletRuntime, WorkletRuntimeConfig } from './types'; +import type { WorkletFunction, WorkletRuntime } from './workletTypes'; +/** + * Lets you create a new JS runtime which can be used to run worklets possibly + * on different threads than JS or UI thread. + * + * @param config - Runtime configuration object - {@link WorkletRuntimeConfig}. + * @returns WorkletRuntime which is a + * `jsi::HostObject` - {@link WorkletRuntime} + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/ + */ export declare function createWorkletRuntime(config?: WorkletRuntimeConfig): WorkletRuntime; +/** + * @deprecated Please use the new config object signature instead: + * `createWorkletRuntime({ name, initializer })` + * + * Lets you create a new JS runtime which can be used to run worklets possibly + * on different threads than JS or UI thread. + * @param name - A name used to identify the runtime which will appear in + * devices list in Chrome DevTools. + * @param initializer - An optional worklet that will be run synchronously on + * the same thread immediately after the runtime is created. + * @returns WorkletRuntime which is a + * `jsi::HostObject` - {@link WorkletRuntime} + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/ + */ export declare function createWorkletRuntime(name?: string, initializer?: () => void): WorkletRuntime; export declare function runOnRuntime(workletRuntime: WorkletRuntime, worklet: (...args: Args) => ReturnValue): WorkletFunction; -export declare function scheduleOnRuntime(workletRuntime: WorkletRuntime, worklet: (...args: Args) => ReturnValue, ...args: Args): void; +/** Configuration object for creating a worklet runtime. */ +export type WorkletRuntimeConfig = { + /** The name of the worklet runtime. */ + name?: string; + /** + * A worklet that will be run immediately after the runtime is created and + * before any other worklets. + */ + initializer?: () => void; + /** + * Time interval in milliseconds between polling of frame callbacks scheduled + * by requestAnimationFrame. If not specified, it defaults to 16 ms. + */ + animationQueuePollingRate?: number; + /** + * Determines whether to enable the default Event Loop or not. The Event Loop + * provides implementations for `setTimeout`, `setImmediate`, `setInterval`, + * `requestAnimationFrame`, `queueMicrotask`, `clearTimeout`, `clearInterval`, + * `clearImmediate`, and `cancelAnimationFrame` methods. If not specified, it + * defaults to `true`. + */ + enableEventLoop?: true; +} & ({ + /** + * If true, the runtime will use the default queue implementation for + * scheduling worklets. Defaults to true. + */ + useDefaultQueue?: true; + /** + * An optional custom queue to be used for scheduling worklets. + * + * The queue has to implement the C++ `AsyncQueue` interface from + * ``. + */ + customQueue?: never; +} | { + /** + * If true, the runtime will use the default queue implementation for + * scheduling worklets. Defaults to true. + */ + useDefaultQueue: false; + /** + * An optional custom queue to be used for scheduling worklets. + * + * The queue has to implement the C++ `AsyncQueue` interface from + * ``. + */ + customQueue?: object; +}); //# sourceMappingURL=runtimes.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/runtimes.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/runtimes.d.ts.map index 21979a42..e546d5db 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/runtimes.d.ts.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/runtimes.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"runtimes.d.ts","sourceRoot":"","sources":["../../src/runtimes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,oBAAoB,CAClC,MAAM,CAAC,EAAE,oBAAoB,GAC5B,cAAc,CAAC;AAElB,wBAAgB,oBAAoB,CAClC,IAAI,CAAC,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,IAAI,GACvB,cAAc,CAAC;AAMlB,wBAAgB,YAAY,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EAC9D,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,GACtC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAMtC,wBAAgB,iBAAiB,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EACnE,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,EACvC,GAAG,IAAI,EAAE,IAAI,GACZ,IAAI,CAAC"} \ No newline at end of file +{"version":3,"file":"runtimes.d.ts","sourceRoot":"","sources":["../../src/runtimes.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEtE;;;;;;;;GAQG;AAEH,wBAAgB,oBAAoB,CAClC,MAAM,CAAC,EAAE,oBAAoB,GAC5B,cAAc,CAAC;AAElB;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,CAAC,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,IAAI,GACvB,cAAc,CAAC;AAsDlB,wBAAgB,YAAY,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EAC9D,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,GACtC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAiCtC,2DAA2D;AAC3D,MAAM,MAAM,oBAAoB,GAAG;IACjC,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;;OAGG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,IAAI,CAAC;CACxB,GAAG,CACA;IACE;;;OAGG;IACH,eAAe,CAAC,EAAE,IAAI,CAAC;IACvB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,GACD;IACE;;;OAGG;IACH,eAAe,EAAE,KAAK,CAAC;IACvB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CACJ,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/runtimes.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/runtimes.native.d.ts deleted file mode 100644 index 9d0f909f..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/runtimes.native.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import type { WorkletFunction, WorkletRuntime, WorkletRuntimeConfig } from './types'; -/** - * Lets you create a new JS runtime which can be used to run worklets possibly - * on different threads than JS or UI thread. - * - * @param config - Runtime configuration object - {@link WorkletRuntimeConfig}. - * @returns WorkletRuntime which is a - * `jsi::HostObject` - {@link WorkletRuntime} - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/ - */ -export declare function createWorkletRuntime(config?: WorkletRuntimeConfig): WorkletRuntime; -/** - * @deprecated Please use the new config object signature instead: - * `createWorkletRuntime({ name, initializer })` - * - * Lets you create a new JS runtime which can be used to run worklets possibly - * on different threads than JS or UI thread. - * @param name - A name used to identify the runtime which will appear in - * devices list in Chrome DevTools. - * @param initializer - An optional worklet that will be run synchronously on - * the same thread immediately after the runtime is created. - * @returns WorkletRuntime which is a - * `jsi::HostObject` - {@link WorkletRuntime} - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/ - */ -export declare function createWorkletRuntime(name?: string, initializer?: () => void): WorkletRuntime; -/** - * Lets you asynchronously run a - * [worklet](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#worklet) - * on a [Worker - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime). - * - * Check - * {@link https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds} - * for more information about the different runtime kinds. - * - * - The worklet is scheduled on the Worker Runtime's [Async - * Queue](https://github.com/software-mansion/react-native-reanimated/blob/main/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h) - * - The function cannot be scheduled on the Worker Runtime from [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime) - * or another [Worker - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime), - * unless the [Bundle - * Mode](https://docs.swmansion.com/react-native-worklets/docs/experimental/bundleMode) - * is enabled. - * - * @param workletRuntime - The runtime to schedule the worklet on. - * @param worklet - The worklet to schedule. - * @param args - The arguments to pass to the worklet. - * @returns The return value of the worklet. - */ -export declare function scheduleOnRuntime(workletRuntime: WorkletRuntime, worklet: (...args: Args) => ReturnValue, ...args: Args): void; -/** - * @deprecated Use `scheduleOnRuntime` instead. - * - * Schedule a worklet to execute on the background queue. - */ -export declare function runOnRuntime(workletRuntime: WorkletRuntime, worklet: (...args: Args) => ReturnValue): WorkletFunction; -//# sourceMappingURL=runtimes.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/runtimes.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/runtimes.native.d.ts.map deleted file mode 100644 index ecadafab..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/runtimes.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"runtimes.native.d.ts","sourceRoot":"","sources":["../../src/runtimes.native.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAIjB;;;;;;;;GAQG;AAEH,wBAAgB,oBAAoB,CAClC,MAAM,CAAC,EAAE,oBAAoB,GAC5B,cAAc,CAAC;AAElB;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,CAAC,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,IAAI,GACvB,cAAc,CAAC;AAqDlB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,wBAAgB,iBAAiB,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EACnE,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,EACvC,GAAG,IAAI,EAAE,IAAI,GACZ,IAAI,CAAC;AAiCR;;;;GAIG;AAGH,wBAAgB,YAAY,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EAC9D,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,GACtC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/NativeWorkletsModule.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/NativeWorkletsModule.d.ts index 0735db80..f8694f19 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/NativeWorkletsModule.d.ts +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/NativeWorkletsModule.d.ts @@ -1,4 +1,4 @@ -import { type TurboModule } from 'react-native'; +import type { TurboModule } from 'react-native'; export interface Spec extends TurboModule { installTurboModule: () => boolean; } diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/NativeWorkletsModule.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/NativeWorkletsModule.d.ts.map index fd3abe92..fc3f81bc 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/NativeWorkletsModule.d.ts.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/NativeWorkletsModule.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"NativeWorkletsModule.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeWorkletsModule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,cAAc,CAAC;AAErE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,kBAAkB,EAAE,MAAM,OAAO,CAAC;CACnC;;AAED,wBAA+D"} \ No newline at end of file +{"version":3,"file":"NativeWorkletsModule.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeWorkletsModule.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,kBAAkB,EAAE,MAAM,OAAO,CAAC;CACnC;;AAED,wBAA+D"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/index.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/index.d.ts index 25e87065..67b63f19 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/index.d.ts +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/index.d.ts @@ -1,3 +1,3 @@ import type { Spec } from './NativeWorkletsModule'; -export declare const WorkletsTurboModule: Spec | null | undefined; +export declare const WorkletsTurboModule: Spec | null; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/index.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/index.d.ts.map index 606d705e..1cd7bb79 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/index.d.ts.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/specs/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/specs/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAGnD,eAAO,MAAM,mBAAmB,EAAE,IAAI,GAAG,IAAI,GAAG,SAMtC,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/specs/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAGnD,eAAO,MAAM,mBAAmB,EAAE,IAAI,GAAG,IAM/B,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/threads.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/threads.d.ts index 8b95dcef..6860be6d 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/threads.d.ts +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/threads.d.ts @@ -1,10 +1,138 @@ -export declare function callMicrotasks(): void; +import type { WorkletFunction } from './workletTypes'; +export declare function setupMicrotasks(): void; +export declare const callMicrotasks: () => void; +/** + * Lets you schedule a function to be executed on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * + * - The callback executes asynchronously and doesn't return a value. + * - Passed function and args are automatically + * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) + * and serialized. + * - This function cannot be called from the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime) + * or [Worker + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#worker-worklet-runtime---worker-runtime), + * unless you have the [Bundle Mode](/docs/experimental/bundleMode) enabled. + * + * @param fun - A reference to a function you want to schedule on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * @param args - Arguments to pass to the function. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnUI + */ export declare function scheduleOnUI(worklet: (...args: Args) => ReturnValue, ...args: Args): void; +/** + * Lets you asynchronously run + * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) + * functions on the [UI + * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/). + * + * This method does not schedule the work immediately but instead waits for + * other worklets to be scheduled within the same JS loop. It uses + * queueMicrotask to schedule all the worklets at once making sure they will run + * within the same frame boundaries on the UI thread. + * + * @param fun - A reference to a function you want to execute on the [UI + * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/) + * from the [JavaScript + * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/). + * @returns A function that accepts arguments for the function passed as the + * first argument. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI @deprecated Use `scheduleOnUI` instead. + */ export declare function runOnUI(worklet: (...args: Args) => ReturnValue): (...args: Args) => void; +/** + * Lets you run a function synchronously on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime) + * from the [RN + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#react-native-runtime-rn-runtime). + * Passed function and args are automatically + * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) + * and serialized. + * + * - This function cannot be called from the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * - This function cannot be called from a [Worker + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#worker-worklet-runtime---worker-runtime). + * + * @param fun - A reference to a function you want to execute on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * @param args - Arguments to pass to the function. + * @returns The return value of the function passed as the first argument. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUISync + */ export declare function runOnUISync(worklet: (...args: Args) => ReturnValue, ...args: Args): ReturnValue; export declare function executeOnUIRuntimeSync(worklet: (...args: Args) => ReturnValue): (...args: Args) => ReturnValue; -export declare function runOnJS(fun: (...args: Args) => ReturnValue): (...args: Args) => void; -export declare function scheduleOnRN(fun: (...args: Args) => ReturnValue, ...args: Args): void; -export declare function runOnUIAsync(worklet: (...args: Args) => ReturnValue, ...args: Args): Promise; -export declare function unstable_eventLoopTask(): never; +type ReleaseRemoteFunction = { + (...args: Args): ReturnValue; +}; +type DevRemoteFunction = { + __remoteFunction: (...args: Args) => ReturnValue; +}; +type RemoteFunction = ReleaseRemoteFunction | DevRemoteFunction; +/** + * Lets you asynchronously run + * non-[workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) + * functions that couldn't otherwise run on the [UI + * thread](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-thread). + * This applies to most external libraries as they don't have their functions + * marked with "worklet"; directive. + * + * @param fun - A reference to a function you want to execute on the JavaScript + * thread from the UI thread. + * @returns A function that accepts arguments for the function passed as the + * first argument. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnJS + */ +/** @deprecated Use `scheduleOnRN` instead. */ +export declare function runOnJS(fun: ((...args: Args) => ReturnValue) | RemoteFunction | WorkletFunction): (...args: Args) => void; +/** + * Lets you schedule a function to be executed on the RN runtime from any + * runtime. Check + * {@link https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds} + * for more information about the different runtime kinds. + * + * Scheduling function from the RN Runtime (we are already on RN Runtime) simply + * uses `queueMicrotask`. + * + * When functions need to be scheduled from the UI Runtime, first function and + * args are serialized and then the system passes the scheduling responsibility + * to the JSScheduler. The JSScheduler then uses the RN CallInvoker to schedule + * the function asynchronously on the JavaScript thread by calling + * `jsCallInvoker_->invokeAsync()`. + * + * When called from a Worker Runtime, it uses the same JSScheduler mechanism. + * + * @param fun - A function you want to schedule on the RN runtime. A function + * can be a worklet, a remote function or a regular function. + * @param args - Arguments to pass to the function. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnRN + */ +export declare function scheduleOnRN(fun: ((...args: Args) => ReturnValue) | RemoteFunction | WorkletFunction, ...args: Args): void; +/** + * Lets you asynchronously run + * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) + * functions on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * + * This method does not schedule the work immediately but instead waits for + * other worklets to be scheduled within the same JS loop. It uses + * queueMicrotask to schedule all the worklets at once making sure they will run + * within the same frame boundaries on the UI thread. + * + * @param fun - A reference to a function you want to execute on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * from the [JavaScript + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#javascript-runtime). + * @returns A promise that resolves to the return value of the function passed + * as the first argument. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUIAsync + */ +export declare function runOnUIAsync(worklet: (...args: Args) => ReturnValue): (...args: Args) => Promise; +/** + * Added temporarily for integration with `react-native-audio-api`. Don't depend + * on this API as it may change without notice. + */ +export declare function unstable_eventLoopTask(worklet: (...args: TArgs) => TRet): (...args: TArgs) => void; +export {}; //# sourceMappingURL=threads.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/threads.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/threads.d.ts.map index a7f8e0ca..5f65422d 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/threads.d.ts.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/threads.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"threads.d.ts","sourceRoot":"","sources":["../../src/threads.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AE,EAAE,IAAI,EAClE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,IAEzB,GAAG,MAAM,KAAK,UAKvB"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/threads.native.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/threads.native.d.ts deleted file mode 100644 index c9420fed..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/threads.native.d.ts +++ /dev/null @@ -1,139 +0,0 @@ -import type { WorkletFunction } from './types'; -export declare function setupMicrotasks(): void; -declare function callMicrotasksOnUIThread(): void; -export declare const callMicrotasks: typeof callMicrotasksOnUIThread; -/** - * Lets you schedule a function to be executed on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * - * - The callback executes asynchronously and doesn't return a value. - * - Passed function and args are automatically - * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) - * and serialized. - * - This function cannot be called from the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime) - * or a [Worker - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime), - * unless you have the [Bundle Mode](/docs/experimental/bundleMode) enabled. - * - * @param fun - A reference to a function you want to schedule on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * @param args - Arguments to pass to the function. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnUI - */ -export declare function scheduleOnUI(worklet: (...args: Args) => ReturnValue, ...args: Args): void; -/** - * Lets you asynchronously run - * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) - * functions on the [UI - * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/). - * - * This method does not schedule the work immediately but instead waits for - * other worklets to be scheduled within the same JS loop. It uses - * queueMicrotask to schedule all the worklets at once making sure they will run - * within the same frame boundaries on the UI thread. - * - * @param fun - A reference to a function you want to execute on the [UI - * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/) - * from the [JavaScript - * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/). - * @returns A function that accepts arguments for the function passed as the - * first argument. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI @deprecated Use `scheduleOnUI` instead. - */ -export declare function runOnUI(worklet: (...args: Args) => ReturnValue): (...args: Args) => void; -/** - * Lets you run a function synchronously on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime) - * from the [RN - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#rn-runtime). - * Passed function and args are automatically - * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) - * and serialized. - * - * - This function cannot be called from the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * - This function cannot be called from a [Worker - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime). - * - * @param fun - A reference to a function you want to execute on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * @param args - Arguments to pass to the function. - * @returns The return value of the function passed as the first argument. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUISync - */ -export declare function runOnUISync(worklet: (...args: Args) => ReturnValue, ...args: Args): ReturnValue; -export declare function executeOnUIRuntimeSync(worklet: (...args: Args) => ReturnValue): (...args: Args) => ReturnValue; -type ReleaseRemoteFunction = { - (...args: Args): ReturnValue; -}; -type DevRemoteFunction = { - __remoteFunction: (...args: Args) => ReturnValue; -}; -type RemoteFunction = ReleaseRemoteFunction | DevRemoteFunction; -/** - * Lets you schedule a function to be executed on the RN runtime from any - * runtime. Check - * {@link https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds} - * for more information about the different runtime kinds. - * - * Scheduling function from the RN Runtime (we are already on RN Runtime) simply - * uses `queueMicrotask`. - * - * When functions need to be scheduled from the UI Runtime, first function and - * args are serialized and then the system passes the scheduling responsibility - * to the JSScheduler. The JSScheduler then uses the RN CallInvoker to schedule - * the function asynchronously on the JavaScript thread by calling - * `jsCallInvoker_->invokeAsync()`. - * - * When called from a Worker Runtime, it uses the same JSScheduler mechanism. - * - * @param fun - A function you want to schedule on the RN runtime. A function - * can be a worklet, a remote function or a regular function. - * @param args - Arguments to pass to the function. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnRN - */ -export declare function scheduleOnRN(fun: ((...args: Args) => ReturnValue) | RemoteFunction | WorkletFunction, ...args: Args): void; -/** - * Lets you asynchronously run - * non-[workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) - * functions that couldn't otherwise run on the [UI - * thread](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-thread). - * This applies to most external libraries as they don't have their functions - * marked with "worklet"; directive. - * - * @param fun - A reference to a function you want to execute on the JavaScript - * thread from the UI thread. - * @returns A function that accepts arguments for the function passed as the - * first argument. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnJS - */ -/** @deprecated Use `scheduleOnRN` instead. */ -export declare function runOnJS(fun: ((...args: Args) => ReturnValue) | RemoteFunction | WorkletFunction): (...args: Args) => void; -/** - * Lets you asynchronously run - * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) - * functions on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * - * This method does not schedule the work immediately but instead waits for - * other worklets to be scheduled within the same JS loop. It uses - * queueMicrotask to schedule all the worklets at once making sure they will run - * within the same frame boundaries on the UI thread. - * - * @param fun - A reference to a function you want to execute on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * from the [JavaScript - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#javascript-runtime). - * @returns A promise that resolves to the return value of the function passed - * as the first argument. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUIAsync - */ -export declare function runOnUIAsync(worklet: (...args: Args) => ReturnValue, ...args: Args): Promise; -/** - * Added temporarily for integration with `react-native-audio-api`. Don't depend - * on this API as it may change without notice. - */ -export declare function unstable_eventLoopTask(worklet: (...args: TArgs) => TRet): (...args: TArgs) => void; -export {}; -//# sourceMappingURL=threads.native.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/threads.native.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/threads.native.d.ts.map deleted file mode 100644 index 684fd732..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/threads.native.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"threads.native.d.ts","sourceRoot":"","sources":["../../src/threads.native.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAY9D,wBAAgB,eAAe,SA0B9B;AAED,iBAAS,wBAAwB,SAGhC;AAED,eAAO,MAAM,cAAc,iCAA2B,CAAC;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AAGH,wBAAgB,YAAY,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EAC9D,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,EACvC,GAAG,IAAI,EAAE,IAAI,GACZ,IAAI,CAAC;AA0BR;;;;;;;;;;;;;;;;;;GAkBG;AAGH,wBAAgB,OAAO,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EACzD,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,GACtC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;AA6B3B;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,w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AAI,EAAE,IAAI,KAAK,WAAW,CAAC,GAChC,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,GACjC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,GACrC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,IAAI,CAKzB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EAC9D,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,EACvC,GAAG,IAAI,EAAE,IAAI,GACZ,OAAO,CAAC,WAAW,CAAC,CAiBtB;AA8CD;;;GAGG;AAEH,wBAAgB,sBAAsB,CAAC,KAAK,SAAS,OAAO,EAAE,EAAE,IAAI,EAClE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,IAEzB,GAAG,MAAM,KAAK,UAKvB"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/types.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/types.d.ts deleted file mode 100644 index 2b42a86b..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/types.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -import type { RuntimeKind } from './runtimeKind'; -/** Public globals to be exposed to the user. */ -declare global { - /** - * @deprecated Use {@link __RUNTIME_KIND} instead. - * - * This global variable is a diagnostic/development tool. - * - * It's `true` on Worklet Runtimes and `false` on React Native Runtime. - */ - var _WORKLET: boolean | undefined; - /** - * This ArrayBuffer contains the memory address of `jsi::Runtime` which is the - * Reanimated UI runtime. - */ - var _WORKLET_RUNTIME: ArrayBuffer; - /** @deprecated Don't use. */ - var _IS_FABRIC: boolean | undefined; - /** - * This global variable is used to determine the kind of the current runtime. - * You can use it directly to differentiate between runtimes. However, the - * recommended way for differentiating is to use the {@link getRuntimeKind} - * function. - * - * - Value _1_: React Native Runtime - * - Value _2_: UI Worklet Runtime - * - Value _3_: Worker Worklet Runtime - */ - var __RUNTIME_KIND: RuntimeKind | 1 | 2 | 3; -} -export type WorkletRuntime = { - __hostObjectWorkletRuntime: never; - readonly name: string; -}; -export type WorkletStackDetails = [ - error: Error, - lineOffset: number, - columnOffset: number -]; -export type WorkletClosure = Record; -interface WorkletInitData { - code: string; - /** Only in dev builds. */ - location?: string; - /** Only in dev builds. */ - sourceMap?: string; -} -interface WorkletProps { - __closure: WorkletClosure; - __workletHash: number; - /** Only in Legacy Bundling. */ - __initData?: WorkletInitData; - /** Only for Handles. */ - __init?: () => unknown; - /** `__stackDetails` is removed after parsing. */ - __stackDetails?: WorkletStackDetails; - /** Only in dev builds. */ - __pluginVersion?: string; -} -export type WorkletFunction = ((...args: TArgs) => TReturn) & WorkletProps; -export interface WorkletFactory = Record> { - (closureVariables: TClosureVariables): WorkletFunction; -} -export type ValueUnpacker = WorkletFunction<[ - objectToUnpack: unknown, - category?: string -], unknown>; -export interface WorkletImport { - __bundleData: { - /** Name of the module which is the source of the import. */ - source: string; - /** The name of the imported value. */ - imported: string; - }; -} -/** Configuration object for creating a worklet runtime. */ -export type WorkletRuntimeConfig = { - /** The name of the worklet runtime. */ - name?: string; - /** - * A worklet that will be run immediately after the runtime is created and - * before any other worklets. - */ - initializer?: () => void; - /** - * Time interval in milliseconds between polling of frame callbacks scheduled - * by requestAnimationFrame. If not specified, it defaults to 16 ms. - */ - animationQueuePollingRate?: number; - /** - * Determines whether to enable the default Event Loop or not. The Event Loop - * provides implementations for `setTimeout`, `setImmediate`, `setInterval`, - * `requestAnimationFrame`, `queueMicrotask`, `clearTimeout`, `clearInterval`, - * `clearImmediate`, and `cancelAnimationFrame` methods. If not specified, it - * defaults to `true`. - */ - enableEventLoop?: true; -} & ({ - /** - * If true, the runtime will use the default queue implementation for - * scheduling worklets. Defaults to true. - */ - useDefaultQueue?: true; - /** - * An optional custom queue to be used for scheduling worklets. - * - * The queue has to implement the C++ `AsyncQueue` interface from - * ``. - */ - customQueue?: never; -} | { - /** - * If true, the runtime will use the default queue implementation for - * scheduling worklets. Defaults to true. - */ - useDefaultQueue: false; - /** - * An optional custom queue to be used for scheduling worklets. - * - * The queue has to implement the C++ `AsyncQueue` interface from - * ``. - */ - customQueue?: object; -}); -export {}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/types.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/types.d.ts.map deleted file mode 100644 index 7263f683..00000000 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,gDAAgD;AAChD,OAAO,CAAC,MAAM,CAAC;IACb;;;;;;OAMG;IACH,IAAI,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAElC;;;OAGG;IACH,IAAI,gBAAgB,EAAE,WAAW,CAAC;IAElC,6BAA6B;IAC7B,IAAI,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAEpC;;;;;;;;;OASG;IACH,IAAI,cAAc,EAAE,WAAW,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC7C;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,0BAA0B,EAAE,KAAK,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,MAAM;IAClB,YAAY,EAAE,MAAM;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAErD,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;I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IAAI,CAAC;IACzB;;;OAGG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,IAAI,CAAC;CACxB,GAAG,CACA;IACE;;;OAGG;IACH,eAAe,CAAC,EAAE,IAAI,CAAC;IACvB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,GACD;IACE;;;OAGG;IACH,eAAe,EAAE,KAAK,CAAC;IACvB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CACJ,CAAC"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/workletFunction.d.ts b/frontend-admin/node_modules/react-native-worklets/lib/typescript/workletFunction.d.ts index c39f0c5d..52cff1bf 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/workletFunction.d.ts +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/workletFunction.d.ts @@ -1,8 +1,9 @@ -import type { WorkletFunction } from './types'; +import type { WorkletFunction } from './workletTypes'; /** * This function allows you to determine if a given function is a worklet. It - * only works with Worklets Babel plugin enabled. Unless you are doing something - * with internals of Worklets you shouldn't need to use this function. + * only works with Reanimated Babel plugin enabled. Unless you are doing + * something with internals of Reanimated you shouldn't need to use this + * function. * * ### Note * diff --git a/frontend-admin/node_modules/react-native-worklets/lib/typescript/workletFunction.d.ts.map b/frontend-admin/node_modules/react-native-worklets/lib/typescript/workletFunction.d.ts.map index 36b82acf..197ed923 100644 --- a/frontend-admin/node_modules/react-native-worklets/lib/typescript/workletFunction.d.ts.map +++ b/frontend-admin/node_modules/react-native-worklets/lib/typescript/workletFunction.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"workletFunction.d.ts","sourceRoot":"","sources":["../../src/workletFunction.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE,EAClC,WAAW,GAAG,OAAO,EACrB,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAU7D"} \ No newline at end of file +{"version":3,"file":"workletFunction.d.ts","sourceRoot":"","sources":["../../src/workletFunction.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE,EAClC,WAAW,GAAG,OAAO,EACrB,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAU7D"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties/LICENSE b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties/LICENSE deleted file mode 100644 index f31575ec..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties/README.md b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties/README.md deleted file mode 100644 index 7000ec5b..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/plugin-transform-class-properties - -> This plugin transforms static class properties as well as properties declared with the property initializer syntax - -See our website [@babel/plugin-transform-class-properties](https://babeljs.io/docs/babel-plugin-transform-class-properties) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/plugin-transform-class-properties -``` - -or using yarn: - -```sh -yarn add @babel/plugin-transform-class-properties --dev -``` diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties/lib/index.js b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties/lib/index.js deleted file mode 100644 index c542e543..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties/lib/index.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -var _helperPluginUtils = require("@babel/helper-plugin-utils"); -var _helperCreateClassFeaturesPlugin = require("@babel/helper-create-class-features-plugin"); -var _default = exports.default = (0, _helperPluginUtils.declare)((api, options) => { - api.assertVersion(7); - return (0, _helperCreateClassFeaturesPlugin.createClassFeaturePlugin)({ - name: "transform-class-properties", - api, - feature: _helperCreateClassFeaturesPlugin.FEATURES.fields, - loose: options.loose, - manipulateOptions(opts, parserOpts) { - { - parserOpts.plugins.push("classProperties", "classPrivateProperties"); - } - } - }); -}); - -//# sourceMappingURL=index.js.map diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties/lib/index.js.map b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties/lib/index.js.map deleted file mode 100644 index 18e0ac5b..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_helperPluginUtils","require","_helperCreateClassFeaturesPlugin","_default","exports","default","declare","api","options","assertVersion","createClassFeaturePlugin","name","feature","FEATURES","fields","loose","manipulateOptions","opts","parserOpts","plugins","push"],"sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable @babel/development/plugin-name */\n\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport {\n createClassFeaturePlugin,\n FEATURES,\n} from \"@babel/helper-create-class-features-plugin\";\n\nexport interface Options {\n loose?: boolean;\n}\n\nexport default declare((api, options: Options) => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n return createClassFeaturePlugin({\n name: \"transform-class-properties\",\n\n api,\n feature: FEATURES.fields,\n loose: options.loose,\n\n manipulateOptions(opts, parserOpts) {\n if (!process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) These plugins have been removed\n parserOpts.plugins.push(\"classProperties\", \"classPrivateProperties\");\n }\n },\n });\n});\n"],"mappings":";;;;;;AAEA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,gCAAA,GAAAD,OAAA;AAGoD,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMrC,IAAAC,0BAAO,EAAC,CAACC,GAAG,EAAEC,OAAgB,KAAK;EAChDD,GAAG,CAACE,aAAa,CAAkB,CAAE,CAAC;EAEtC,OAAO,IAAAC,yDAAwB,EAAC;IAC9BC,IAAI,EAAE,4BAA4B;IAElCJ,GAAG;IACHK,OAAO,EAAEC,yCAAQ,CAACC,MAAM;IACxBC,KAAK,EAAEP,OAAO,CAACO,KAAK;IAEpBC,iBAAiBA,CAACC,IAAI,EAAEC,UAAU,EAAE;MACC;QAEjCA,UAAU,CAACC,OAAO,CAACC,IAAI,CAAC,iBAAiB,EAAE,wBAAwB,CAAC;MACtE;IACF;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties/package.json b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties/package.json deleted file mode 100644 index 40139773..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@babel/plugin-transform-class-properties", - "version": "7.27.1", - "description": "This plugin transforms static class properties as well as properties declared with the property initializer syntax", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-plugin-transform-class-properties" - }, - "homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-class-properties", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "main": "./lib/index.js", - "keywords": [ - "babel-plugin" - ], - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.27.1", - "@babel/helper-plugin-utils": "^7.27.1" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - }, - "devDependencies": { - "@babel/core": "^7.27.1", - "@babel/helper-plugin-test-runner": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "author": "The Babel Team (https://babel.dev/team)", - "type": "commonjs" -} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/LICENSE b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/LICENSE deleted file mode 100644 index f31575ec..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/README.md b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/README.md deleted file mode 100644 index b552b0d7..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/plugin-transform-classes - -> Compile ES2015 classes to ES5 - -See our website [@babel/plugin-transform-classes](https://babeljs.io/docs/babel-plugin-transform-classes) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/plugin-transform-classes -``` - -or using yarn: - -```sh -yarn add @babel/plugin-transform-classes --dev -``` diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/index.js b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/index.js deleted file mode 100644 index dc193fa3..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/index.js +++ /dev/null @@ -1,76 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -var _helperPluginUtils = require("@babel/helper-plugin-utils"); -var _helperCompilationTargets = require("@babel/helper-compilation-targets"); -var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure"); -var _core = require("@babel/core"); -var _transformClass = require("./transformClass.js"); -const globalsBrowserUpper = require("@babel/helper-globals/data/browser-upper.json"), - globalsBuiltinUpper = require("@babel/helper-globals/data/builtin-upper.json"); -const builtinClasses = new Set([...globalsBrowserUpper, ...globalsBuiltinUpper]); -builtinClasses.delete("Iterator"); -var _default = exports.default = (0, _helperPluginUtils.declare)((api, options) => { - var _api$assumption, _api$assumption2, _api$assumption3, _api$assumption4; - api.assertVersion(7); - const { - loose = false - } = options; - const setClassMethods = (_api$assumption = api.assumption("setClassMethods")) != null ? _api$assumption : loose; - const constantSuper = (_api$assumption2 = api.assumption("constantSuper")) != null ? _api$assumption2 : loose; - const superIsCallableConstructor = (_api$assumption3 = api.assumption("superIsCallableConstructor")) != null ? _api$assumption3 : loose; - const noClassCalls = (_api$assumption4 = api.assumption("noClassCalls")) != null ? _api$assumption4 : loose; - const supportUnicodeId = !(0, _helperCompilationTargets.isRequired)("transform-unicode-escapes", api.targets()); - const VISITED = new WeakSet(); - return { - name: "transform-classes", - visitor: { - ExportDefaultDeclaration(path) { - if (!path.get("declaration").isClassDeclaration()) return; - { - var _path$splitExportDecl; - (_path$splitExportDecl = path.splitExportDeclaration) != null ? _path$splitExportDecl : path.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration; - } - path.splitExportDeclaration(); - }, - ClassDeclaration(path) { - const { - node - } = path; - const ref = node.id ? _core.types.cloneNode(node.id) : path.scope.generateUidIdentifier("class"); - path.replaceWith(_core.types.variableDeclaration("let", [_core.types.variableDeclarator(ref, _core.types.toExpression(node))])); - }, - ClassExpression(path, state) { - const { - node - } = path; - if (VISITED.has(node)) return; - { - var _path$ensureFunctionN; - (_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName; - } - const replacement = path.ensureFunctionName(supportUnicodeId); - if (replacement && replacement.node !== node) return; - VISITED.add(node); - const [replacedPath] = path.replaceWith((0, _transformClass.default)(path, state.file, builtinClasses, loose, { - setClassMethods, - constantSuper, - superIsCallableConstructor, - noClassCalls - }, supportUnicodeId)); - if (replacedPath.isCallExpression()) { - (0, _helperAnnotateAsPure.default)(replacedPath); - const callee = replacedPath.get("callee"); - if (callee.isArrowFunctionExpression()) { - callee.arrowFunctionToExpression(); - } - } - } - } - }; -}); - -//# sourceMappingURL=index.js.map diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/index.js.map b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/index.js.map deleted file mode 100644 index bf8355ca..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_helperPluginUtils","require","_helperCompilationTargets","_helperAnnotateAsPure","_core","_transformClass","globalsBrowserUpper","globalsBuiltinUpper","builtinClasses","Set","delete","_default","exports","default","declare","api","options","_api$assumption","_api$assumption2","_api$assumption3","_api$assumption4","assertVersion","loose","setClassMethods","assumption","constantSuper","superIsCallableConstructor","noClassCalls","supportUnicodeId","isRequired","targets","VISITED","WeakSet","name","visitor","ExportDefaultDeclaration","path","get","isClassDeclaration","_path$splitExportDecl","splitExportDeclaration","NodePath","prototype","ClassDeclaration","node","ref","id","t","cloneNode","scope","generateUidIdentifier","replaceWith","variableDeclaration","variableDeclarator","toExpression","ClassExpression","state","has","_path$ensureFunctionN","ensureFunctionName","replacement","add","replacedPath","transformClass","file","isCallExpression","annotateAsPure","callee","isArrowFunctionExpression","arrowFunctionToExpression"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport { isRequired } from \"@babel/helper-compilation-targets\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\nimport { types as t } from \"@babel/core\";\nimport globalsBrowserUpper from \"@babel/helper-globals/data/browser-upper.json\" with { type: \"json\" };\nimport globalsBuiltinUpper from \"@babel/helper-globals/data/builtin-upper.json\" with { type: \"json\" };\nimport transformClass from \"./transformClass.ts\";\n\nconst builtinClasses = new Set([\n ...globalsBrowserUpper,\n ...globalsBuiltinUpper,\n]);\n\n// The \"Iterator\" global is removed because the Babel construct helper\n// packages/babel-helpers/src/helpers/construct.ts, emitted from the wrapNativeSuper helper,\n// // will invoke it with `new Iterator()` when native Reflect.construct is not available.\n// However, the abstract class Iterator can not be invoked with new. Since the `builtinClasses`\n// is used for the superIsCallableConstructor assumption, we should prioritize the spec mode\nbuiltinClasses.delete(\"Iterator\");\n\nexport interface Options {\n loose?: boolean;\n}\n\nexport default declare((api, options: Options) => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n const { loose = false } = options;\n\n const setClassMethods = api.assumption(\"setClassMethods\") ?? loose;\n const constantSuper = api.assumption(\"constantSuper\") ?? loose;\n const superIsCallableConstructor =\n api.assumption(\"superIsCallableConstructor\") ?? loose;\n const noClassCalls = api.assumption(\"noClassCalls\") ?? loose;\n const supportUnicodeId = !isRequired(\n \"transform-unicode-escapes\",\n api.targets(),\n );\n\n // todo: investigate traversal requeueing\n const VISITED = new WeakSet();\n\n return {\n name: \"transform-classes\",\n\n visitor: {\n ExportDefaultDeclaration(path) {\n if (!path.get(\"declaration\").isClassDeclaration()) return;\n if (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // polyfill when being run by an older Babel version\n path.splitExportDeclaration ??=\n // eslint-disable-next-line no-restricted-globals\n require(\"@babel/traverse\").NodePath.prototype.splitExportDeclaration;\n }\n path.splitExportDeclaration();\n },\n\n ClassDeclaration(path) {\n const { node } = path;\n\n const ref = node.id\n ? t.cloneNode(node.id)\n : path.scope.generateUidIdentifier(\"class\");\n\n path.replaceWith(\n t.variableDeclaration(\"let\", [\n t.variableDeclarator(ref, t.toExpression(node)),\n ]),\n );\n },\n\n ClassExpression(path, state) {\n const { node } = path;\n if (VISITED.has(node)) return;\n\n if (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // polyfill when being run by an older Babel version\n path.ensureFunctionName ??=\n // eslint-disable-next-line no-restricted-globals\n require(\"@babel/traverse\").NodePath.prototype.ensureFunctionName;\n }\n const replacement = path.ensureFunctionName(supportUnicodeId);\n if (replacement && replacement.node !== node) return;\n\n VISITED.add(node);\n\n const [replacedPath] = path.replaceWith(\n transformClass(\n path,\n state.file,\n builtinClasses,\n loose,\n {\n setClassMethods,\n constantSuper,\n superIsCallableConstructor,\n noClassCalls,\n },\n supportUnicodeId,\n ),\n );\n\n if (replacedPath.isCallExpression()) {\n annotateAsPure(replacedPath);\n const callee = replacedPath.get(\"callee\");\n if (callee.isArrowFunctionExpression()) {\n // This is an IIFE, so we don't need to worry about the noNewArrows assumption\n callee.arrowFunctionToExpression();\n }\n }\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAGA,IAAAI,eAAA,GAAAJ,OAAA;AAAiD,MAF1CK,mBAAmB,GAAAL,OAAA,CAAM,+CAA+C;EACxEM,mBAAmB,GAAAN,OAAA,CAAM,+CAA+C;AAG/E,MAAMO,cAAc,GAAG,IAAIC,GAAG,CAAC,CAC7B,GAAGH,mBAAmB,EACtB,GAAGC,mBAAmB,CACvB,CAAC;AAOFC,cAAc,CAACE,MAAM,CAAC,UAAU,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMnB,IAAAC,0BAAO,EAAC,CAACC,GAAG,EAAEC,OAAgB,KAAK;EAAA,IAAAC,eAAA,EAAAC,g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5B,MAAMK,MAAM,GAAGL,YAAY,CAACzB,GAAG,CAAC,QAAQ,CAAC;UACzC,IAAI8B,MAAM,CAACC,yBAAyB,CAAC,CAAC,EAAE;YAEtCD,MAAM,CAACE,yBAAyB,CAAC,CAAC;UACpC;QACF;MACF;IACF;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/inline-callSuper-helpers.js b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/inline-callSuper-helpers.js deleted file mode 100644 index c67e343e..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/inline-callSuper-helpers.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = addCallSuperHelper; -var _core = require("@babel/core"); -const helper = _core.template.statement` - function CALL_SUPER( - _this, - derived, - args, - ) { - function isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - - // core-js@3 - if (Reflect.construct.sham) return false; - - // Proxy can't be polyfilled. Every browser implemented - // proxies before or at the same time as Reflect.construct, - // so if they support Proxy they also support Reflect.construct. - if (typeof Proxy === "function") return true; - - // Since Reflect.construct can't be properly polyfilled, some - // implementations (e.g. core-js@2) don't set the correct internal slots. - // Those polyfills don't allow us to subclass built-ins, so we need to - // use our fallback implementation. - try { - // If the internal slots aren't set, this throws an error similar to - // TypeError: this is not a Boolean object. - return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}),); - } catch (e) { - return false; - } - } - - // Super - derived = GET_PROTOTYPE_OF(derived); - return POSSIBLE_CONSTRUCTOR_RETURN( - _this, - isNativeReflectConstruct() - ? // NOTE: This doesn't work if this.__proto__.constructor has been modified. - Reflect.construct( - derived, - args || [], - GET_PROTOTYPE_OF(_this).constructor, - ) - : derived.apply(_this, args), - ); - } -`; -const helperIDs = new WeakMap(); -function addCallSuperHelper(file) { - if (helperIDs.has(file)) { - { - return (_core.types.cloneNode || _core.types.clone)(helperIDs.get(file)); - } - } - try { - return file.addHelper("callSuper"); - } catch (_unused) {} - const id = file.scope.generateUidIdentifier("callSuper"); - helperIDs.set(file, id); - const fn = helper({ - CALL_SUPER: id, - GET_PROTOTYPE_OF: file.addHelper("getPrototypeOf"), - POSSIBLE_CONSTRUCTOR_RETURN: file.addHelper("possibleConstructorReturn") - }); - const [fnPath] = file.path.unshiftContainer("body", [fn]); - file.scope.registerDeclaration(fnPath); - return _core.types.cloneNode(id); -} - -//# sourceMappingURL=inline-callSuper-helpers.js.map diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/inline-callSuper-helpers.js.map b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/inline-callSuper-helpers.js.map deleted file mode 100644 index 5103feda..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/inline-callSuper-helpers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_core","require","helper","template","statement","helperIDs","WeakMap","addCallSuperHelper","file","has","t","cloneNode","clone","get","addHelper","_unused","id","scope","generateUidIdentifier","set","fn","CALL_SUPER","GET_PROTOTYPE_OF","POSSIBLE_CONSTRUCTOR_RETURN","fnPath","path","unshiftContainer","registerDeclaration"],"sources":["../src/inline-callSuper-helpers.ts"],"sourcesContent":["import { template, types as t, type File } from \"@babel/core\";\n\nconst helper = template.statement`\n function CALL_SUPER(\n _this,\n derived,\n args,\n ) {\n function isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n\n // core-js@3\n if (Reflect.construct.sham) return false;\n\n // Proxy can't be polyfilled. Every browser implemented\n // proxies before or at the same time as Reflect.construct,\n // so if they support Proxy they also support Reflect.construct.\n if (typeof Proxy === \"function\") return true;\n\n // Since Reflect.construct can't be properly polyfilled, some\n // implementations (e.g. core-js@2) don't set the correct internal slots.\n // Those polyfills don't allow us to subclass built-ins, so we need to\n // use our fallback implementation.\n try {\n // If the internal slots aren't set, this throws an error similar to\n // TypeError: this is not a Boolean object.\n return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}),);\n } catch (e) {\n return false;\n }\n }\n\n // Super\n derived = GET_PROTOTYPE_OF(derived);\n return POSSIBLE_CONSTRUCTOR_RETURN(\n _this,\n isNativeReflectConstruct()\n ? // NOTE: This doesn't work if this.__proto__.constructor has been modified.\n Reflect.construct(\n derived,\n args || [],\n GET_PROTOTYPE_OF(_this).constructor,\n )\n : derived.apply(_this, args),\n );\n }\n`;\n\nconst helperIDs = new WeakMap();\n\nexport default function addCallSuperHelper(file: File) {\n if (helperIDs.has(file)) {\n if (process.env.BABEL_8_BREAKING) {\n return t.cloneNode(helperIDs.get(file));\n } else {\n // t.cloneNode isn't supported in every version\n return (t.cloneNode || t.clone)(helperIDs.get(file));\n }\n }\n\n try {\n return file.addHelper(\"callSuper\");\n } catch {\n // old Babel doesn't support the helper.\n }\n\n const id = file.scope.generateUidIdentifier(\"callSuper\");\n helperIDs.set(file, id);\n\n const fn = helper({\n CALL_SUPER: id,\n GET_PROTOTYPE_OF: file.addHelper(\"getPrototypeOf\"),\n POSSIBLE_CONSTRUCTOR_RETURN: file.addHelper(\"possibleConstructorReturn\"),\n });\n\n const [fnPath] = file.path.unshiftContainer(\"body\", [fn]);\n file.scope.registerDeclaration(fnPath);\n\n return t.cloneNode(id);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,MAAMC,MAAM,GAAGC,cAAQ,CAACC,SAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,MAAMC,SAAS,GAAG,IAAIC,OAAO,CAAC,CAAC;AAEhB,SAASC,kBAAkBA,CAACC,IAAU,EAAE;EACrD,IAAIH,SAAS,CAACI,GAAG,CAACD,IAAI,CAAC,EAAE;IAGhB;MAEL,OAAO,CAACE,WAAC,CAACC,SAAS,IAAID,WAAC,CAACE,KAAK,EAAEP,SAAS,CAACQ,GAAG,CAACL,IAAI,CAAC,CAAC;IACtD;EACF;EAEA,IAAI;IACF,OAAOA,IAAI,CAACM,SAAS,CAAC,WAAW,CAAC;EACpC,CAAC,CAAC,OAAAC,OAAA,EAAM,CAER;EAEA,MAAMC,EAAE,GAAGR,IAAI,CAACS,KAAK,CAACC,qBAAqB,CAAC,WAAW,CAAC;EACxDb,SAAS,CAACc,GAAG,CAACX,IAAI,EAAEQ,EAAE,CAAC;EAEvB,MAAMI,EAAE,GAAGlB,MAAM,CAAC;IAChBmB,UAAU,EAAEL,EAAE;IACdM,gBAAgB,EAAEd,IAAI,CAACM,SAAS,CAAC,gBAAgB,CAAC;IAClDS,2BAA2B,EAAEf,IAAI,CAACM,SAAS,CAAC,2BAA2B;EACzE,CAAC,CAAC;EAEF,MAAM,CAACU,MAAM,CAAC,GAAGhB,IAAI,CAACiB,IAAI,CAACC,gBAAgB,CAAC,MAAM,EAAE,CAACN,EAAE,CAAC,CAAC;EACzDZ,IAAI,CAACS,KAAK,CAACU,mBAAmB,CAACH,MAAM,CAAC;EAEtC,OAAOd,WAAC,CAACC,SAAS,CAACK,EAAE,CAAC;AACxB","ignoreList":[]} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/transformClass.js b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/transformClass.js deleted file mode 100644 index e32bcd53..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/transformClass.js +++ /dev/null @@ -1,540 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = transformClass; -var _helperReplaceSupers = require("@babel/helper-replace-supers"); -var _core = require("@babel/core"); -var _traverse = require("@babel/traverse"); -var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure"); -var _inlineCallSuperHelpers = require("./inline-callSuper-helpers.js"); -function buildConstructor(classRef, constructorBody, node) { - const func = _core.types.functionDeclaration(_core.types.cloneNode(classRef), [], constructorBody); - _core.types.inherits(func, node); - return func; -} -function transformClass(path, file, builtinClasses, isLoose, assumptions, supportUnicodeId) { - const classState = { - parent: undefined, - scope: undefined, - node: undefined, - path: undefined, - file: undefined, - classId: undefined, - classRef: undefined, - superName: null, - superReturns: [], - isDerived: false, - extendsNative: false, - construct: undefined, - constructorBody: undefined, - userConstructor: undefined, - userConstructorPath: undefined, - hasConstructor: false, - body: [], - superThises: [], - pushedInherits: false, - pushedCreateClass: false, - protoAlias: null, - isLoose: false, - dynamicKeys: new Map(), - methods: { - instance: { - hasComputed: false, - list: [], - map: new Map() - }, - static: { - hasComputed: false, - list: [], - map: new Map() - } - } - }; - const setState = newState => { - Object.assign(classState, newState); - }; - const findThisesVisitor = _traverse.visitors.environmentVisitor({ - ThisExpression(path) { - classState.superThises.push(path); - } - }); - function createClassHelper(args) { - return _core.types.callExpression(classState.file.addHelper("createClass"), args); - } - function maybeCreateConstructor() { - const classBodyPath = classState.path.get("body"); - for (const path of classBodyPath.get("body")) { - if (path.isClassMethod({ - kind: "constructor" - })) return; - } - const params = []; - let body; - if (classState.isDerived) { - body = _core.template.statement.ast`{ - super(...arguments); - }`; - } else { - body = _core.types.blockStatement([]); - } - classBodyPath.unshiftContainer("body", _core.types.classMethod("constructor", _core.types.identifier("constructor"), params, body)); - } - function buildBody() { - maybeCreateConstructor(); - pushBody(); - verifyConstructor(); - if (classState.userConstructor) { - const { - constructorBody, - userConstructor, - construct - } = classState; - constructorBody.body.push(...userConstructor.body.body); - _core.types.inherits(construct, userConstructor); - _core.types.inherits(constructorBody, userConstructor.body); - } - pushDescriptors(); - } - function pushBody() { - const classBodyPaths = classState.path.get("body.body"); - for (const path of classBodyPaths) { - const node = path.node; - if (path.isClassProperty() || path.isClassPrivateProperty()) { - throw path.buildCodeFrameError("Missing class properties transform."); - } - if (node.decorators) { - throw path.buildCodeFrameError("Method has decorators, put the decorator plugin before the classes one."); - } - if (_core.types.isClassMethod(node)) { - const isConstructor = node.kind === "constructor"; - const replaceSupers = new _helperReplaceSupers.default({ - methodPath: path, - objectRef: classState.classRef, - superRef: classState.superName, - constantSuper: assumptions.constantSuper, - file: classState.file, - refToPreserve: classState.classRef - }); - replaceSupers.replace(); - const superReturns = []; - path.traverse(_traverse.visitors.environmentVisitor({ - ReturnStatement(path) { - if (!path.getFunctionParent().isArrowFunctionExpression()) { - superReturns.push(path); - } - } - })); - if (isConstructor) { - pushConstructor(superReturns, node, path); - } else { - { - var _path$ensureFunctionN; - (_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName; - } - path.ensureFunctionName(supportUnicodeId); - let wrapped; - if (node !== path.node) { - wrapped = path.node; - path.replaceWith(node); - } - pushMethod(node, wrapped); - } - } - } - } - function pushDescriptors() { - pushInheritsToBody(); - const { - body - } = classState; - const props = { - instance: null, - static: null - }; - for (const placement of ["static", "instance"]) { - if (classState.methods[placement].list.length) { - props[placement] = classState.methods[placement].list.map(desc => { - const obj = _core.types.objectExpression([_core.types.objectProperty(_core.types.identifier("key"), desc.key)]); - for (const kind of ["get", "set", "value"]) { - if (desc[kind] != null) { - obj.properties.push(_core.types.objectProperty(_core.types.identifier(kind), desc[kind])); - } - } - return obj; - }); - } - } - if (props.instance || props.static) { - let args = [_core.types.cloneNode(classState.classRef), props.instance ? _core.types.arrayExpression(props.instance) : _core.types.nullLiteral(), props.static ? _core.types.arrayExpression(props.static) : _core.types.nullLiteral()]; - let lastNonNullIndex = 0; - for (let i = 0; i < args.length; i++) { - if (!_core.types.isNullLiteral(args[i])) lastNonNullIndex = i; - } - args = args.slice(0, lastNonNullIndex + 1); - body.push(_core.types.returnStatement(createClassHelper(args))); - classState.pushedCreateClass = true; - } - } - function wrapSuperCall(bareSuper, superRef, thisRef, body) { - const bareSuperNode = bareSuper.node; - let call; - if (assumptions.superIsCallableConstructor) { - bareSuperNode.arguments.unshift(_core.types.thisExpression()); - if (bareSuperNode.arguments.length === 2 && _core.types.isSpreadElement(bareSuperNode.arguments[1]) && _core.types.isIdentifier(bareSuperNode.arguments[1].argument, { - name: "arguments" - })) { - bareSuperNode.arguments[1] = bareSuperNode.arguments[1].argument; - bareSuperNode.callee = _core.types.memberExpression(_core.types.cloneNode(superRef), _core.types.identifier("apply")); - } else { - bareSuperNode.callee = _core.types.memberExpression(_core.types.cloneNode(superRef), _core.types.identifier("call")); - } - call = _core.types.logicalExpression("||", bareSuperNode, _core.types.thisExpression()); - } else { - var _bareSuperNode$argume; - const args = [_core.types.thisExpression(), _core.types.cloneNode(classState.classRef)]; - if ((_bareSuperNode$argume = bareSuperNode.arguments) != null && _bareSuperNode$argume.length) { - const bareSuperNodeArguments = bareSuperNode.arguments; - if (bareSuperNodeArguments.length === 1 && _core.types.isSpreadElement(bareSuperNodeArguments[0]) && _core.types.isIdentifier(bareSuperNodeArguments[0].argument, { - name: "arguments" - })) { - args.push(bareSuperNodeArguments[0].argument); - } else { - args.push(_core.types.arrayExpression(bareSuperNodeArguments)); - } - } - call = _core.types.callExpression((0, _inlineCallSuperHelpers.default)(classState.file), args); - } - if (bareSuper.parentPath.isExpressionStatement() && bareSuper.parentPath.container === body.node.body && body.node.body.length - 1 === bareSuper.parentPath.key) { - if (classState.superThises.length) { - call = _core.types.assignmentExpression("=", thisRef(), call); - } - bareSuper.parentPath.replaceWith(_core.types.returnStatement(call)); - } else { - bareSuper.replaceWith(_core.types.assignmentExpression("=", thisRef(), call)); - } - } - function verifyConstructor() { - if (!classState.isDerived) return; - const path = classState.userConstructorPath; - const body = path.get("body"); - const constructorBody = path.get("body"); - let maxGuaranteedSuperBeforeIndex = constructorBody.node.body.length; - path.traverse(findThisesVisitor); - let thisRef = function () { - const ref = path.scope.generateDeclaredUidIdentifier("this"); - maxGuaranteedSuperBeforeIndex++; - thisRef = () => _core.types.cloneNode(ref); - return ref; - }; - const buildAssertThisInitialized = function () { - return _core.types.callExpression(classState.file.addHelper("assertThisInitialized"), [thisRef()]); - }; - const bareSupers = []; - path.traverse(_traverse.visitors.environmentVisitor({ - Super(path) { - const { - node, - parentPath - } = path; - if (parentPath.isCallExpression({ - callee: node - })) { - bareSupers.unshift(parentPath); - } - } - })); - for (const bareSuper of bareSupers) { - wrapSuperCall(bareSuper, classState.superName, thisRef, body); - if (maxGuaranteedSuperBeforeIndex >= 0) { - let lastParentPath; - bareSuper.find(function (parentPath) { - if (parentPath === constructorBody) { - maxGuaranteedSuperBeforeIndex = Math.min(maxGuaranteedSuperBeforeIndex, lastParentPath.key); - return true; - } - const { - type - } = parentPath; - switch (type) { - case "ExpressionStatement": - case "SequenceExpression": - case "AssignmentExpression": - case "BinaryExpression": - case "MemberExpression": - case "CallExpression": - case "NewExpression": - case "VariableDeclarator": - case "VariableDeclaration": - case "BlockStatement": - case "ArrayExpression": - case "ObjectExpression": - case "ObjectProperty": - case "TemplateLiteral": - lastParentPath = parentPath; - return false; - default: - if (type === "LogicalExpression" && parentPath.node.left === lastParentPath.node || parentPath.isConditional() && parentPath.node.test === lastParentPath.node || type === "OptionalCallExpression" && parentPath.node.callee === lastParentPath.node || type === "OptionalMemberExpression" && parentPath.node.object === lastParentPath.node) { - lastParentPath = parentPath; - return false; - } - } - maxGuaranteedSuperBeforeIndex = -1; - return true; - }); - } - } - const guaranteedCalls = new Set(); - for (const thisPath of classState.superThises) { - const { - node, - parentPath - } = thisPath; - if (parentPath.isMemberExpression({ - object: node - })) { - thisPath.replaceWith(thisRef()); - continue; - } - let thisIndex; - thisPath.find(function (parentPath) { - if (parentPath.parentPath === constructorBody) { - thisIndex = parentPath.key; - return true; - } - }); - let exprPath = thisPath.parentPath.isSequenceExpression() ? thisPath.parentPath : thisPath; - if (exprPath.listKey === "arguments" && (exprPath.parentPath.isCallExpression() || exprPath.parentPath.isOptionalCallExpression())) { - exprPath = exprPath.parentPath; - } else { - exprPath = null; - } - if (maxGuaranteedSuperBeforeIndex !== -1 && thisIndex > maxGuaranteedSuperBeforeIndex || guaranteedCalls.has(exprPath)) { - thisPath.replaceWith(thisRef()); - } else { - if (exprPath) { - guaranteedCalls.add(exprPath); - } - thisPath.replaceWith(buildAssertThisInitialized()); - } - } - let wrapReturn; - if (classState.isLoose) { - wrapReturn = returnArg => { - const thisExpr = buildAssertThisInitialized(); - return returnArg ? _core.types.logicalExpression("||", returnArg, thisExpr) : thisExpr; - }; - } else { - wrapReturn = returnArg => { - const returnParams = [thisRef()]; - if (returnArg != null) { - returnParams.push(returnArg); - } - return _core.types.callExpression(classState.file.addHelper("possibleConstructorReturn"), returnParams); - }; - } - const bodyPaths = body.get("body"); - const guaranteedSuperBeforeFinish = maxGuaranteedSuperBeforeIndex !== -1 && maxGuaranteedSuperBeforeIndex < bodyPaths.length; - if (!bodyPaths.length || !bodyPaths.pop().isReturnStatement()) { - body.pushContainer("body", _core.types.returnStatement(guaranteedSuperBeforeFinish ? thisRef() : buildAssertThisInitialized())); - } - for (const returnPath of classState.superReturns) { - returnPath.get("argument").replaceWith(wrapReturn(returnPath.node.argument)); - } - } - function pushMethod(node, wrapped) { - if (node.kind === "method") { - if (processMethod(node)) return; - } - const placement = node.static ? "static" : "instance"; - const methods = classState.methods[placement]; - const descKey = node.kind === "method" ? "value" : node.kind; - const key = _core.types.isNumericLiteral(node.key) || _core.types.isBigIntLiteral(node.key) ? _core.types.stringLiteral(String(node.key.value)) : _core.types.toComputedKey(node); - methods.hasComputed = !_core.types.isStringLiteral(key); - const fn = wrapped != null ? wrapped : _core.types.toExpression(node); - let descriptor; - if (!methods.hasComputed && methods.map.has(key.value)) { - descriptor = methods.map.get(key.value); - descriptor[descKey] = fn; - if (descKey === "value") { - descriptor.get = null; - descriptor.set = null; - } else { - descriptor.value = null; - } - } else { - descriptor = { - key: key, - [descKey]: fn - }; - methods.list.push(descriptor); - if (!methods.hasComputed) { - methods.map.set(key.value, descriptor); - } - } - } - function processMethod(node) { - if (assumptions.setClassMethods && !node.decorators) { - let { - classRef - } = classState; - if (!node.static) { - insertProtoAliasOnce(); - classRef = classState.protoAlias; - } - const methodName = _core.types.memberExpression(_core.types.cloneNode(classRef), node.key, node.computed || _core.types.isLiteral(node.key)); - const func = _core.types.functionExpression(node.id, node.params, node.body, node.generator, node.async); - _core.types.inherits(func, node); - const expr = _core.types.expressionStatement(_core.types.assignmentExpression("=", methodName, func)); - _core.types.inheritsComments(expr, node); - classState.body.push(expr); - return true; - } - return false; - } - function insertProtoAliasOnce() { - if (classState.protoAlias === null) { - setState({ - protoAlias: classState.scope.generateUidIdentifier("proto") - }); - const classProto = _core.types.memberExpression(classState.classRef, _core.types.identifier("prototype")); - const protoDeclaration = _core.types.variableDeclaration("var", [_core.types.variableDeclarator(classState.protoAlias, classProto)]); - classState.body.push(protoDeclaration); - } - } - function pushConstructor(superReturns, method, path) { - setState({ - userConstructorPath: path, - userConstructor: method, - hasConstructor: true, - superReturns - }); - const { - construct - } = classState; - _core.types.inheritsComments(construct, method); - construct.params = method.params; - _core.types.inherits(construct.body, method.body); - construct.body.directives = method.body.directives; - if (classState.hasInstanceDescriptors || classState.hasStaticDescriptors) { - pushDescriptors(); - } - pushInheritsToBody(); - } - function pushInheritsToBody() { - if (!classState.isDerived || classState.pushedInherits) return; - classState.pushedInherits = true; - classState.body.unshift(_core.types.expressionStatement(_core.types.callExpression(classState.file.addHelper(classState.isLoose ? "inheritsLoose" : "inherits"), [_core.types.cloneNode(classState.classRef), _core.types.cloneNode(classState.superName)]))); - } - function extractDynamicKeys() { - const { - dynamicKeys, - node, - scope - } = classState; - for (const elem of node.body.body) { - if (!_core.types.isClassMethod(elem) || !elem.computed) continue; - if (scope.isPure(elem.key, true)) continue; - const id = scope.generateUidIdentifierBasedOnNode(elem.key); - dynamicKeys.set(id.name, elem.key); - elem.key = id; - } - } - function setupClosureParamsArgs() { - const { - superName, - dynamicKeys - } = classState; - const closureParams = []; - const closureArgs = []; - if (classState.isDerived) { - let arg = _core.types.cloneNode(superName); - if (classState.extendsNative) { - arg = _core.types.callExpression(classState.file.addHelper("wrapNativeSuper"), [arg]); - (0, _helperAnnotateAsPure.default)(arg); - } - const param = classState.scope.generateUidIdentifierBasedOnNode(superName); - closureParams.push(param); - closureArgs.push(arg); - setState({ - superName: _core.types.cloneNode(param) - }); - } - for (const [name, value] of dynamicKeys) { - closureParams.push(_core.types.identifier(name)); - closureArgs.push(value); - } - return { - closureParams, - closureArgs - }; - } - function classTransformer(path, file, builtinClasses, isLoose) { - setState({ - parent: path.parent, - scope: path.scope, - node: path.node, - path, - file, - isLoose - }); - setState({ - classId: classState.node.id, - classRef: classState.node.id ? _core.types.identifier(classState.node.id.name) : classState.scope.generateUidIdentifier("class"), - superName: classState.node.superClass, - isDerived: !!classState.node.superClass, - constructorBody: _core.types.blockStatement([]) - }); - setState({ - extendsNative: _core.types.isIdentifier(classState.superName) && builtinClasses.has(classState.superName.name) && !classState.scope.hasBinding(classState.superName.name, true) - }); - const { - classRef, - node, - constructorBody - } = classState; - setState({ - construct: buildConstructor(classRef, constructorBody, node) - }); - extractDynamicKeys(); - const { - body - } = classState; - const { - closureParams, - closureArgs - } = setupClosureParamsArgs(); - buildBody(); - if (!assumptions.noClassCalls) { - constructorBody.body.unshift(_core.types.expressionStatement(_core.types.callExpression(classState.file.addHelper("classCallCheck"), [_core.types.thisExpression(), _core.types.cloneNode(classState.classRef)]))); - } - const isStrict = path.isInStrictMode(); - let constructorOnly = body.length === 0; - if (constructorOnly && !isStrict) { - for (const param of classState.construct.params) { - if (!_core.types.isIdentifier(param)) { - constructorOnly = false; - break; - } - } - } - const directives = constructorOnly ? classState.construct.body.directives : []; - if (!isStrict) { - directives.push(_core.types.directive(_core.types.directiveLiteral("use strict"))); - } - if (constructorOnly) { - const expr = _core.types.toExpression(classState.construct); - return classState.isLoose ? expr : createClassHelper([expr]); - } - if (!classState.pushedCreateClass) { - body.push(_core.types.returnStatement(classState.isLoose ? _core.types.cloneNode(classState.classRef) : createClassHelper([_core.types.cloneNode(classState.classRef)]))); - } - body.unshift(classState.construct); - const container = _core.types.arrowFunctionExpression(closureParams, _core.types.blockStatement(body, directives)); - return _core.types.callExpression(container, closureArgs); - } - return classTransformer(path, file, builtinClasses, isLoose); -} - -//# sourceMappingURL=transformClass.js.map diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/transformClass.js.map b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/transformClass.js.map deleted file mode 100644 index c4d767d3..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/lib/transformClass.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_helperReplaceSupers","require","_core","_traverse","_helperAnnotateAsPure","_inlineCallSuperHelpers","buildConstructor","classRef","constructorBody","node","func","t","functionDeclaration","cloneNode","inherits","transformClass","path","file","builtinClasses","isLoose","assumptions","supportUnicodeId","classState","parent","undefined","scope","classId","superName","superReturns","isDerived","extendsNative","construct","userConstructor","userConstructorPath","hasConstructor","body","superThises","pushedInherits","pushedCreateClass","protoAlias","dynamicKeys","Map","methods","instance","hasComputed","list","map","static","setState","newState","Object","assign","findThisesVisitor","visitors","environmentVisitor","ThisExpression","push","createClassHelper","args","callExpression","addHelper","maybeCreateConstructor","classBodyPath","get","isClassMethod","kind","params","template","statement","ast","blockStatement","unshiftContainer","classMethod","identifier","buildBody","pushBody","verifyConstructor","pushDescriptors","classBodyPaths","isClassProperty","isClassPrivateProperty","buildCodeFrameError","decorators","isConstructor","replaceSupers","ReplaceSupers","methodPath","objectRef","superRef","constantSuper","refToPreserve","replace","traverse","ReturnStatement","getFunctionParent","isArrowFunctionExpression","pushConstructor","_path$ensureFunctionN","ensureFunctionName","NodePath","prototype","wrapped","replaceWith","pushMethod","pushInheritsToBody","props","placement","length","desc","obj","objectExpression","objectProperty","key","properties","arrayExpression","nullLiteral","lastNonNullIndex","i","isNullLiteral","slice","returnStatement","wrapSuperCall","bareSuper","thisRef","bareSuperNode","call","superIsCallableConstructor","arguments","unshift","thisExpression","isSpreadElement","isIdentifier","argument","name","callee","memberExpression","logicalExpression","_bareSuperNode$argume","bareSuperNodeArguments","addCallSuperHelper","parentPath","isExpressionStatement","container","assignmentExpression","maxGuaranteedSuperBeforeIndex","ref","generateDeclaredUidIdentifier","buildAssertThisInitialized","bareSupers","Super","isCallExpression","lastParentPath","find","Math","min","type","left","isConditional","test","object","guaranteedCalls","Set","thisPath","isMemberExpression","thisIndex","exprPath","isSequenceExpression","listKey","isOptionalCallExpression","has","add","wrapReturn","returnArg","thisExpr","returnParams","bodyPaths","guaranteedSuperBeforeFinish","pop","isReturnStatement","pushContainer","returnPath","processMethod","descKey","isNumericLiteral","isBigIntLiteral","stringLiteral","String","value","toComputedKey","isStringLiteral","fn","toExpression","descriptor","set","setClassMethods","insertProtoAliasOnce","methodName","computed","isLiteral","functionExpression","id","generator","async","expr","expressionStatement","inheritsComments","generateUidIdentifier","classProto","protoDeclaration","variableDeclaration","variableDeclarator","method","directives","hasInstanceDescriptors","hasStaticDescriptors","extractDynamicKeys","elem","isPure","generateUidIdentifierBasedOnNode","setupClosureParamsArgs","closureParams","closureArgs","arg","annotateAsPure","param","classTransformer","superClass","hasBinding","noClassCalls","isStrict","isInStrictMode","constructorOnly","directive","directiveLiteral","arrowFunctionExpression"],"sources":["../src/transformClass.ts"],"sourcesContent":["import type { NodePath, Scope, File } from \"@babel/core\";\nimport ReplaceSupers from \"@babel/helper-replace-supers\";\nimport { template, types as t } from \"@babel/core\";\nimport { visitors } from \"@babel/traverse\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\n\nimport addCallSuperHelper from \"./inline-callSuper-helpers.ts\";\n\ntype ClassAssumptions = {\n setClassMethods: boolean;\n constantSuper: boolean;\n superIsCallableConstructor: boolean;\n noClassCalls: boolean;\n};\n\ntype ClassConstructor = t.ClassMethod & { kind: \"constructor\" };\n\nfunction buildConstructor(\n classRef: t.Identifier,\n constructorBody: t.BlockStatement,\n node: t.Class,\n) {\n const func = t.functionDeclaration(\n t.cloneNode(classRef),\n [],\n constructorBody,\n );\n t.inherits(func, node);\n return func;\n}\n\ntype Descriptor = {\n key: t.Expression;\n get?: t.Expression | null;\n set?: t.Expression | null;\n value?: t.Expression | null;\n constructor?: t.Expression | null;\n};\n\ntype State = {\n parent: t.Node;\n scope: Scope;\n node: t.Class;\n path: NodePath;\n file: File;\n\n classId: t.Identifier | void;\n classRef: t.Identifier;\n superName: t.Expression | null;\n superReturns: NodePath[];\n isDerived: boolean;\n extendsNative: boolean;\n\n construct: t.FunctionDeclaration;\n constructorBody: t.BlockStatement;\n userConstructor: ClassConstructor;\n userConstructorPath: NodePath;\n hasConstructor: boolean;\n\n body: t.Statement[];\n superThises: NodePath[];\n pushedInherits: boolean;\n pushedCreateClass: boolean;\n protoAlias: t.Identifier | null;\n isLoose: boolean;\n\n dynamicKeys: Map;\n\n methods: {\n // 'list' is in the same order as the elements appear in the class body.\n // if there aren't computed keys, we can safely reorder class elements\n // and use 'map' to merge duplicates.\n instance: {\n hasComputed: boolean;\n list: Descriptor[];\n map: Map;\n };\n static: {\n hasComputed: boolean;\n list: Descriptor[];\n map: Map;\n };\n };\n};\n\ntype PropertyInfo = {\n instance: t.ObjectExpression[] | null;\n static: t.ObjectExpression[] | null;\n};\n\nexport default function transformClass(\n path: NodePath,\n file: File,\n builtinClasses: ReadonlySet,\n isLoose: boolean,\n assumptions: ClassAssumptions,\n supportUnicodeId: boolean,\n) {\n const classState: State = {\n parent: undefined,\n scope: undefined,\n node: undefined,\n path: undefined,\n file: undefined,\n\n classId: undefined,\n classRef: undefined,\n superName: null,\n superReturns: [],\n isDerived: false,\n extendsNative: false,\n\n construct: undefined,\n constructorBody: undefined,\n userConstructor: undefined,\n userConstructorPath: undefined,\n hasConstructor: false,\n\n body: [],\n superThises: [],\n pushedInherits: false,\n pushedCreateClass: false,\n protoAlias: null,\n isLoose: false,\n\n dynamicKeys: new Map(),\n\n methods: {\n instance: {\n hasComputed: false,\n list: [],\n map: new Map(),\n },\n static: {\n hasComputed: false,\n list: [],\n map: new Map(),\n },\n },\n };\n\n const setState = (newState: Partial) => {\n Object.assign(classState, newState);\n };\n\n const findThisesVisitor = visitors.environmentVisitor({\n ThisExpression(path) {\n classState.superThises.push(path);\n },\n });\n\n function createClassHelper(args: t.Expression[]) {\n return t.callExpression(classState.file.addHelper(\"createClass\"), args);\n }\n\n /**\n * Creates a class constructor or bail out if there is one\n */\n function maybeCreateConstructor() {\n const classBodyPath = classState.path.get(\"body\");\n for (const path of classBodyPath.get(\"body\")) {\n if (path.isClassMethod({ kind: \"constructor\" })) return;\n }\n\n const params: t.FunctionExpression[\"params\"] = [];\n let body;\n\n if (classState.isDerived) {\n body = template.statement.ast`{\n super(...arguments);\n }` as t.BlockStatement;\n } else {\n body = t.blockStatement([]);\n }\n\n classBodyPath.unshiftContainer(\n \"body\",\n t.classMethod(\"constructor\", t.identifier(\"constructor\"), params, body),\n );\n }\n\n function buildBody() {\n maybeCreateConstructor();\n pushBody();\n verifyConstructor();\n\n if (classState.userConstructor) {\n const { constructorBody, userConstructor, construct } = classState;\n\n constructorBody.body.push(...userConstructor.body.body);\n t.inherits(construct, userConstructor);\n t.inherits(constructorBody, userConstructor.body);\n }\n\n pushDescriptors();\n }\n\n function pushBody() {\n const classBodyPaths: Array = classState.path.get(\"body.body\");\n\n for (const path of classBodyPaths) {\n const node = path.node;\n\n if (path.isClassProperty() || path.isClassPrivateProperty()) {\n throw path.buildCodeFrameError(\"Missing class properties transform.\");\n }\n\n if (node.decorators) {\n throw path.buildCodeFrameError(\n \"Method has decorators, put the decorator plugin before the classes one.\",\n );\n }\n\n if (t.isClassMethod(node)) {\n const isConstructor = node.kind === \"constructor\";\n\n const replaceSupers = new ReplaceSupers({\n methodPath: path,\n objectRef: classState.classRef,\n superRef: classState.superName,\n constantSuper: assumptions.constantSuper,\n file: classState.file,\n refToPreserve: classState.classRef,\n });\n\n replaceSupers.replace();\n\n const superReturns: NodePath[] = [];\n path.traverse(\n visitors.environmentVisitor({\n ReturnStatement(path) {\n if (!path.getFunctionParent().isArrowFunctionExpression()) {\n superReturns.push(path);\n }\n },\n }),\n );\n\n if (isConstructor) {\n pushConstructor(superReturns, node as ClassConstructor, path);\n } else {\n if (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // polyfill when being run by an older Babel version\n path.ensureFunctionName ??=\n // eslint-disable-next-line no-restricted-globals\n require(\"@babel/traverse\").NodePath.prototype.ensureFunctionName;\n }\n path.ensureFunctionName(supportUnicodeId);\n let wrapped;\n if (node !== path.node) {\n wrapped = path.node;\n // The node has been wrapped. Reset it to the original once, but store the wrapper.\n path.replaceWith(node);\n }\n\n pushMethod(node, wrapped);\n }\n }\n }\n }\n\n function pushDescriptors() {\n pushInheritsToBody();\n\n const { body } = classState;\n\n const props: PropertyInfo = {\n instance: null,\n static: null,\n };\n\n for (const placement of [\"static\", \"instance\"] as const) {\n if (classState.methods[placement].list.length) {\n props[placement] = classState.methods[placement].list.map(desc => {\n const obj = t.objectExpression([\n t.objectProperty(t.identifier(\"key\"), desc.key),\n ]);\n\n for (const kind of [\"get\", \"set\", \"value\"] as const) {\n if (desc[kind] != null) {\n obj.properties.push(\n t.objectProperty(t.identifier(kind), desc[kind]),\n );\n }\n }\n\n return obj;\n });\n }\n }\n\n if (props.instance || props.static) {\n let args = [\n t.cloneNode(classState.classRef), // Constructor\n props.instance ? t.arrayExpression(props.instance) : t.nullLiteral(), // instanceDescriptors\n props.static ? t.arrayExpression(props.static) : t.nullLiteral(), // staticDescriptors\n ];\n\n let lastNonNullIndex = 0;\n for (let i = 0; i < args.length; i++) {\n if (!t.isNullLiteral(args[i])) lastNonNullIndex = i;\n }\n args = args.slice(0, lastNonNullIndex + 1);\n\n body.push(t.returnStatement(createClassHelper(args)));\n classState.pushedCreateClass = true;\n }\n }\n\n function wrapSuperCall(\n bareSuper: NodePath,\n superRef: t.Expression,\n thisRef: () => t.Identifier,\n body: NodePath,\n ) {\n const bareSuperNode = bareSuper.node;\n let call;\n\n if (assumptions.superIsCallableConstructor) {\n bareSuperNode.arguments.unshift(t.thisExpression());\n if (\n bareSuperNode.arguments.length === 2 &&\n t.isSpreadElement(bareSuperNode.arguments[1]) &&\n t.isIdentifier(bareSuperNode.arguments[1].argument, {\n name: \"arguments\",\n })\n ) {\n // special case single arguments spread\n bareSuperNode.arguments[1] = bareSuperNode.arguments[1].argument;\n bareSuperNode.callee = t.memberExpression(\n t.cloneNode(superRef),\n t.identifier(\"apply\"),\n );\n } else {\n bareSuperNode.callee = t.memberExpression(\n t.cloneNode(superRef),\n t.identifier(\"call\"),\n );\n }\n\n call = t.logicalExpression(\"||\", bareSuperNode, t.thisExpression());\n } else {\n const args: t.Expression[] = [\n t.thisExpression(),\n t.cloneNode(classState.classRef),\n ];\n if (bareSuperNode.arguments?.length) {\n const bareSuperNodeArguments = bareSuperNode.arguments as (\n | t.Expression\n | t.SpreadElement\n )[];\n\n /**\n * test262/test/language/expressions/super/call-spread-err-sngl-err-itr-get-get.js\n *\n * var iter = {};\n * Object.defineProperty(iter, Symbol.iterator, {\n * get: function() {\n * throw new Test262Error();\n * }\n * })\n * super(...iter);\n */\n\n if (\n bareSuperNodeArguments.length === 1 &&\n t.isSpreadElement(bareSuperNodeArguments[0]) &&\n t.isIdentifier(bareSuperNodeArguments[0].argument, {\n name: \"arguments\",\n })\n ) {\n args.push(bareSuperNodeArguments[0].argument);\n } else {\n args.push(t.arrayExpression(bareSuperNodeArguments));\n }\n }\n call = t.callExpression(addCallSuperHelper(classState.file), args);\n }\n\n if (\n bareSuper.parentPath.isExpressionStatement() &&\n bareSuper.parentPath.container === body.node.body &&\n body.node.body.length - 1 === bareSuper.parentPath.key\n ) {\n // this super call is the last statement in the body so we can just straight up\n // turn it into a return\n\n if (classState.superThises.length) {\n call = t.assignmentExpression(\"=\", thisRef(), call);\n }\n\n bareSuper.parentPath.replaceWith(t.returnStatement(call));\n } else {\n bareSuper.replaceWith(t.assignmentExpression(\"=\", thisRef(), call));\n }\n }\n\n function verifyConstructor() {\n if (!classState.isDerived) return;\n\n const path = classState.userConstructorPath;\n const body = path.get(\"body\");\n\n const constructorBody = path.get(\"body\");\n\n let maxGuaranteedSuperBeforeIndex = constructorBody.node.body.length;\n\n path.traverse(findThisesVisitor);\n\n let thisRef = function () {\n const ref = path.scope.generateDeclaredUidIdentifier(\"this\");\n maxGuaranteedSuperBeforeIndex++;\n thisRef = () => t.cloneNode(ref);\n return ref;\n };\n\n const buildAssertThisInitialized = function () {\n return t.callExpression(\n classState.file.addHelper(\"assertThisInitialized\"),\n [thisRef()],\n );\n };\n\n const bareSupers: NodePath[] = [];\n path.traverse(\n visitors.environmentVisitor({\n Super(path) {\n const { node, parentPath } = path;\n if (parentPath.isCallExpression({ callee: node })) {\n bareSupers.unshift(parentPath);\n }\n },\n }),\n );\n\n for (const bareSuper of bareSupers) {\n wrapSuperCall(bareSuper, classState.superName, thisRef, body);\n\n if (maxGuaranteedSuperBeforeIndex >= 0) {\n let lastParentPath: NodePath;\n bareSuper.find(function (parentPath) {\n // hit top so short circuit\n if (parentPath === constructorBody) {\n maxGuaranteedSuperBeforeIndex = Math.min(\n maxGuaranteedSuperBeforeIndex,\n lastParentPath.key as number,\n );\n return true;\n }\n\n const { type } = parentPath;\n switch (type) {\n case \"ExpressionStatement\":\n case \"SequenceExpression\":\n case \"AssignmentExpression\":\n case \"BinaryExpression\":\n case \"MemberExpression\":\n case \"CallExpression\":\n case \"NewExpression\":\n case \"VariableDeclarator\":\n case \"VariableDeclaration\":\n case \"BlockStatement\":\n case \"ArrayExpression\":\n case \"ObjectExpression\":\n case \"ObjectProperty\":\n case \"TemplateLiteral\":\n lastParentPath = parentPath;\n return false;\n default:\n if (\n (type === \"LogicalExpression\" &&\n parentPath.node.left === lastParentPath.node) ||\n (parentPath.isConditional() &&\n parentPath.node.test === lastParentPath.node) ||\n (type === \"OptionalCallExpression\" &&\n parentPath.node.callee === lastParentPath.node) ||\n (type === \"OptionalMemberExpression\" &&\n parentPath.node.object === lastParentPath.node)\n ) {\n lastParentPath = parentPath;\n return false;\n }\n }\n\n maxGuaranteedSuperBeforeIndex = -1;\n return true;\n });\n }\n }\n\n const guaranteedCalls = new Set();\n\n for (const thisPath of classState.superThises) {\n const { node, parentPath } = thisPath;\n if (parentPath.isMemberExpression({ object: node })) {\n thisPath.replaceWith(thisRef());\n continue;\n }\n\n let thisIndex: number;\n thisPath.find(function (parentPath) {\n if (parentPath.parentPath === constructorBody) {\n thisIndex = parentPath.key as number;\n return true;\n }\n });\n\n let exprPath: NodePath = thisPath.parentPath.isSequenceExpression()\n ? thisPath.parentPath\n : thisPath;\n if (\n exprPath.listKey === \"arguments\" &&\n (exprPath.parentPath.isCallExpression() ||\n exprPath.parentPath.isOptionalCallExpression())\n ) {\n exprPath = exprPath.parentPath;\n } else {\n exprPath = null;\n }\n\n if (\n (maxGuaranteedSuperBeforeIndex !== -1 &&\n thisIndex > maxGuaranteedSuperBeforeIndex) ||\n guaranteedCalls.has(exprPath)\n ) {\n thisPath.replaceWith(thisRef());\n } else {\n if (exprPath) {\n guaranteedCalls.add(exprPath);\n }\n thisPath.replaceWith(buildAssertThisInitialized());\n }\n }\n\n let wrapReturn;\n\n if (classState.isLoose) {\n wrapReturn = (returnArg: t.Expression | void) => {\n const thisExpr = buildAssertThisInitialized();\n return returnArg\n ? t.logicalExpression(\"||\", returnArg, thisExpr)\n : thisExpr;\n };\n } else {\n wrapReturn = (returnArg: t.Expression | undefined) => {\n const returnParams: t.Expression[] = [thisRef()];\n if (returnArg != null) {\n returnParams.push(returnArg);\n }\n return t.callExpression(\n classState.file.addHelper(\"possibleConstructorReturn\"),\n returnParams,\n );\n };\n }\n\n // if we have a return as the last node in the body then we've already caught that\n // return\n const bodyPaths = body.get(\"body\");\n const guaranteedSuperBeforeFinish =\n maxGuaranteedSuperBeforeIndex !== -1 &&\n maxGuaranteedSuperBeforeIndex < bodyPaths.length;\n if (!bodyPaths.length || !bodyPaths.pop().isReturnStatement()) {\n body.pushContainer(\n \"body\",\n t.returnStatement(\n guaranteedSuperBeforeFinish\n ? thisRef()\n : buildAssertThisInitialized(),\n ),\n );\n }\n\n for (const returnPath of classState.superReturns) {\n returnPath\n .get(\"argument\")\n .replaceWith(wrapReturn(returnPath.node.argument));\n }\n }\n\n /**\n * Push a method to its respective mutatorMap.\n */\n function pushMethod(node: t.ClassMethod, wrapped?: t.Expression) {\n if (node.kind === \"method\") {\n if (processMethod(node)) return;\n }\n\n const placement = node.static ? \"static\" : \"instance\";\n const methods = classState.methods[placement];\n\n const descKey = node.kind === \"method\" ? \"value\" : node.kind;\n const key =\n t.isNumericLiteral(node.key) || t.isBigIntLiteral(node.key)\n ? t.stringLiteral(String(node.key.value))\n : t.toComputedKey(node);\n methods.hasComputed = !t.isStringLiteral(key);\n\n const fn: t.Expression = wrapped ?? t.toExpression(node);\n\n let descriptor: Descriptor;\n if (\n !methods.hasComputed &&\n methods.map.has((key as t.StringLiteral).value)\n ) {\n descriptor = methods.map.get((key as t.StringLiteral).value);\n descriptor[descKey] = fn;\n\n if (descKey === \"value\") {\n descriptor.get = null;\n descriptor.set = null;\n } else {\n descriptor.value = null;\n }\n } else {\n descriptor = {\n key:\n // private name has been handled in class-properties transform\n key as t.Expression,\n [descKey]: fn,\n } as Descriptor;\n methods.list.push(descriptor);\n\n if (!methods.hasComputed) {\n methods.map.set((key as t.StringLiteral).value, descriptor);\n }\n }\n }\n\n function processMethod(node: t.ClassMethod) {\n if (assumptions.setClassMethods && !node.decorators) {\n // use assignments instead of define properties for loose classes\n let { classRef } = classState;\n if (!node.static) {\n insertProtoAliasOnce();\n classRef = classState.protoAlias;\n }\n const methodName = t.memberExpression(\n t.cloneNode(classRef),\n node.key,\n node.computed || t.isLiteral(node.key),\n );\n\n const func: t.Expression = t.functionExpression(\n // @ts-expect-error We actually set and id through .ensureFunctionName\n node.id,\n // @ts-expect-error Fixme: should throw when we see TSParameterProperty\n node.params,\n node.body,\n node.generator,\n node.async,\n );\n t.inherits(func, node);\n\n const expr = t.expressionStatement(\n t.assignmentExpression(\"=\", methodName, func),\n );\n t.inheritsComments(expr, node);\n classState.body.push(expr);\n return true;\n }\n\n return false;\n }\n\n function insertProtoAliasOnce() {\n if (classState.protoAlias === null) {\n setState({ protoAlias: classState.scope.generateUidIdentifier(\"proto\") });\n const classProto = t.memberExpression(\n classState.classRef,\n t.identifier(\"prototype\"),\n );\n const protoDeclaration = t.variableDeclaration(\"var\", [\n t.variableDeclarator(classState.protoAlias, classProto),\n ]);\n\n classState.body.push(protoDeclaration);\n }\n }\n\n /**\n * Replace the constructor body of our class.\n */\n function pushConstructor(\n superReturns: NodePath[],\n method: ClassConstructor,\n path: NodePath,\n ) {\n setState({\n userConstructorPath: path,\n userConstructor: method,\n hasConstructor: true,\n superReturns,\n });\n\n const { construct } = classState;\n\n t.inheritsComments(construct, method);\n\n // @ts-expect-error Fixme: should throw when we see TSParameterProperty\n construct.params = method.params;\n\n t.inherits(construct.body, method.body);\n construct.body.directives = method.body.directives;\n\n // we haven't pushed any descriptors yet\n // @ts-expect-error todo(flow->ts) maybe remove this block - properties from condition are not used anywhere else\n if (classState.hasInstanceDescriptors || classState.hasStaticDescriptors) {\n pushDescriptors();\n }\n\n pushInheritsToBody();\n }\n\n /**\n * Push inherits helper to body.\n */\n function pushInheritsToBody() {\n if (!classState.isDerived || classState.pushedInherits) return;\n\n classState.pushedInherits = true;\n\n // Unshift to ensure that the constructor inheritance is set up before\n // any properties can be assigned to the prototype.\n\n classState.body.unshift(\n t.expressionStatement(\n t.callExpression(\n classState.file.addHelper(\n classState.isLoose ? \"inheritsLoose\" : \"inherits\",\n ),\n [t.cloneNode(classState.classRef), t.cloneNode(classState.superName)],\n ),\n ),\n );\n }\n\n function extractDynamicKeys() {\n const { dynamicKeys, node, scope } = classState;\n\n for (const elem of node.body.body) {\n if (!t.isClassMethod(elem) || !elem.computed) continue;\n if (scope.isPure(elem.key, /* constants only*/ true)) continue;\n\n const id = scope.generateUidIdentifierBasedOnNode(elem.key);\n dynamicKeys.set(id.name, elem.key);\n\n elem.key = id;\n }\n }\n\n function setupClosureParamsArgs() {\n const { superName, dynamicKeys } = classState;\n const closureParams = [];\n const closureArgs = [];\n\n if (classState.isDerived) {\n let arg = t.cloneNode(superName);\n if (classState.extendsNative) {\n arg = t.callExpression(classState.file.addHelper(\"wrapNativeSuper\"), [\n arg,\n ]);\n annotateAsPure(arg);\n }\n\n const param =\n classState.scope.generateUidIdentifierBasedOnNode(superName);\n\n closureParams.push(param);\n closureArgs.push(arg);\n\n setState({ superName: t.cloneNode(param) });\n }\n\n for (const [name, value] of dynamicKeys) {\n closureParams.push(t.identifier(name));\n closureArgs.push(value);\n }\n\n return { closureParams, closureArgs };\n }\n\n function classTransformer(\n path: NodePath,\n file: File,\n builtinClasses: ReadonlySet,\n isLoose: boolean,\n ) {\n setState({\n parent: path.parent,\n scope: path.scope,\n node: path.node,\n path,\n file,\n isLoose,\n });\n\n setState({\n classId: classState.node.id,\n // this is the name of the binding that will **always** reference the class we've constructed\n classRef: classState.node.id\n ? t.identifier(classState.node.id.name)\n : classState.scope.generateUidIdentifier(\"class\"),\n superName: classState.node.superClass,\n isDerived: !!classState.node.superClass,\n constructorBody: t.blockStatement([]),\n });\n\n setState({\n extendsNative:\n t.isIdentifier(classState.superName) &&\n builtinClasses.has(classState.superName.name) &&\n !classState.scope.hasBinding(\n classState.superName.name,\n /* noGlobals */ true,\n ),\n });\n\n const { classRef, node, constructorBody } = classState;\n\n setState({\n construct: buildConstructor(classRef, constructorBody, node),\n });\n\n extractDynamicKeys();\n\n const { body } = classState;\n const { closureParams, closureArgs } = setupClosureParamsArgs();\n\n buildBody();\n\n // make sure this class isn't directly called (with A() instead new A())\n if (!assumptions.noClassCalls) {\n constructorBody.body.unshift(\n t.expressionStatement(\n t.callExpression(classState.file.addHelper(\"classCallCheck\"), [\n t.thisExpression(),\n t.cloneNode(classState.classRef),\n ]),\n ),\n );\n }\n\n const isStrict = path.isInStrictMode();\n let constructorOnly = body.length === 0;\n if (constructorOnly && !isStrict) {\n for (const param of classState.construct.params) {\n // It's illegal to put a use strict directive into the body of a function\n // with non-simple parameters for some reason. So, we have to use a strict\n // wrapper function.\n if (!t.isIdentifier(param)) {\n constructorOnly = false;\n break;\n }\n }\n }\n\n const directives = constructorOnly\n ? classState.construct.body.directives\n : [];\n if (!isStrict) {\n directives.push(t.directive(t.directiveLiteral(\"use strict\")));\n }\n\n if (constructorOnly) {\n // named class with only a constructor\n const expr = t.toExpression(classState.construct);\n return classState.isLoose ? expr : createClassHelper([expr]);\n }\n\n if (!classState.pushedCreateClass) {\n body.push(\n t.returnStatement(\n classState.isLoose\n ? t.cloneNode(classState.classRef)\n : createClassHelper([t.cloneNode(classState.classRef)]),\n ),\n );\n }\n\n body.unshift(classState.construct);\n\n const container = t.arrowFunctionExpression(\n closureParams,\n t.blockStatement(body, directives),\n );\n return t.callExpression(container, closureArgs);\n }\n\n return classTransformer(path, file, builtinClasses, isLoose);\n}\n"],"mappings":";;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AAEA,IAAAI,uBAAA,GAAAJ,OAAA;AAWA,SAASK,gBAAgBA,CACvBC,QAAsB,EACtBC,eAAiC,EACjCC,IAAa,EACb;EACA,MAAMC,IAAI,GAAGC,WAAC,CAACC,mBAAmB,CAChCD,WAAC,CAACE,SAAS,CAACN,QAAQ,CAAC,EACrB,EAAE,EACFC,eACF,CAAC;EACDG,WAAC,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worklets/node_modules/@babel/plugin-transform-classes/package.json b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/package.json deleted file mode 100644 index 9fd14639..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "@babel/plugin-transform-classes", - "version": "7.28.4", - "description": "Compile ES2015 classes to ES5", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-plugin-transform-classes" - }, - "homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-classes", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "main": "./lib/index.js", - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.27.3", - "@babel/helper-compilation-targets": "^7.27.2", - "@babel/helper-globals": "^7.28.0", - "@babel/helper-plugin-utils": "^7.27.1", - "@babel/helper-replace-supers": "^7.27.1", - "@babel/traverse": "^7.28.4" - }, - "keywords": [ - "babel-plugin" - ], - "peerDependencies": { - "@babel/core": "^7.0.0-0" - }, - "devDependencies": { - "@babel/core": "^7.28.4", - "@babel/helper-plugin-test-runner": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "author": "The Babel Team (https://babel.dev/team)", - "type": "commonjs" -} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator/LICENSE b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator/LICENSE deleted file mode 100644 index f31575ec..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator/README.md b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator/README.md deleted file mode 100644 index 0d98d92c..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/plugin-transform-nullish-coalescing-operator - -> Remove nullish coalescing operator - -See our website [@babel/plugin-transform-nullish-coalescing-operator](https://babeljs.io/docs/babel-plugin-transform-nullish-coalescing-operator) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/plugin-transform-nullish-coalescing-operator -``` - -or using yarn: - -```sh -yarn add @babel/plugin-transform-nullish-coalescing-operator --dev -``` diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator/lib/index.js b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator/lib/index.js deleted file mode 100644 index 738b6e5a..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator/lib/index.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -var _helperPluginUtils = require("@babel/helper-plugin-utils"); -var _core = require("@babel/core"); -var _default = exports.default = (0, _helperPluginUtils.declare)((api, { - loose = false -}) => { - var _api$assumption, _api$assumption2; - api.assertVersion("^7.0.0-0 || >8.0.0-alpha <8.0.0-beta"); - const noDocumentAll = (_api$assumption = api.assumption("noDocumentAll")) != null ? _api$assumption : loose; - const pureGetters = (_api$assumption2 = api.assumption("pureGetters")) != null ? _api$assumption2 : false; - return { - name: "transform-nullish-coalescing-operator", - manipulateOptions: (_, parser) => parser.plugins.push("nullishCoalescingOperator"), - visitor: { - LogicalExpression(path) { - const { - node, - scope - } = path; - if (node.operator !== "??") { - return; - } - let ref; - let assignment; - if (pureGetters && scope.path.isPattern() && _core.types.isMemberExpression(node.left) && !node.left.computed && _core.types.isIdentifier(node.left.object) && _core.types.isIdentifier(node.left.property) || _core.types.isIdentifier(node.left) && (pureGetters || scope.hasBinding(node.left.name))) { - ref = node.left; - assignment = _core.types.cloneNode(node.left); - } else if (scope.path.isPattern()) { - path.replaceWith(_core.template.statement.ast`(() => ${path.node})()`); - return; - } else { - ref = scope.generateUidIdentifierBasedOnNode(node.left); - scope.push({ - id: _core.types.cloneNode(ref) - }); - assignment = _core.types.assignmentExpression("=", ref, node.left); - } - path.replaceWith(_core.types.conditionalExpression(noDocumentAll ? _core.types.binaryExpression("!=", assignment, _core.types.nullLiteral()) : _core.types.logicalExpression("&&", _core.types.binaryExpression("!==", assignment, _core.types.nullLiteral()), _core.types.binaryExpression("!==", _core.types.cloneNode(ref), scope.buildUndefinedNode())), _core.types.cloneNode(ref), node.right)); - } - } - }; -}); - -//# sourceMappingURL=index.js.map diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator/lib/index.js.map b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator/lib/index.js.map deleted file mode 100644 index fe1ebb16..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_helperPluginUtils","require","_core","_default","exports","default","declare","api","loose","_api$assumption","_api$assumption2","assertVersion","noDocumentAll","assumption","pureGetters","name","manipulateOptions","_","parser","plugins","push","visitor","LogicalExpression","path","node","scope","operator","ref","assignment","isPattern","t","isMemberExpression","left","computed","isIdentifier","object","property","hasBinding","cloneNode","replaceWith","template","statement","ast","generateUidIdentifierBasedOnNode","id","assignmentExpression","conditionalExpression","binaryExpression","nullLiteral","logicalExpression","buildUndefinedNode","right"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t, template } from \"@babel/core\";\n\nexport interface Options {\n loose?: boolean;\n}\n\nexport default declare((api, { loose = false }: Options) => {\n api.assertVersion(REQUIRED_VERSION(7));\n const noDocumentAll = api.assumption(\"noDocumentAll\") ?? loose;\n const pureGetters = api.assumption(\"pureGetters\") ?? false;\n\n return {\n name: \"transform-nullish-coalescing-operator\",\n manipulateOptions: process.env.BABEL_8_BREAKING\n ? undefined\n : (_, parser) => parser.plugins.push(\"nullishCoalescingOperator\"),\n\n visitor: {\n LogicalExpression(path) {\n const { node, scope } = path;\n if (node.operator !== \"??\") {\n return;\n }\n\n let ref;\n let assignment;\n // skip creating extra reference when `left` is pure\n if (\n (pureGetters &&\n scope.path.isPattern() &&\n t.isMemberExpression(node.left) &&\n !node.left.computed &&\n t.isIdentifier(node.left.object) &&\n t.isIdentifier(node.left.property)) ||\n (t.isIdentifier(node.left) &&\n (pureGetters ||\n // globalThis\n scope.hasBinding(node.left.name)))\n ) {\n ref = node.left;\n assignment = t.cloneNode(node.left);\n } else if (scope.path.isPattern()) {\n // Replace `function (a, x = a.b ?? c) {}` to `function (a, x = (() => a.b ?? c)() ){}`\n // so the temporary variable can be injected in correct scope\n path.replaceWith(template.statement.ast`(() => ${path.node})()`);\n // The injected nullish expression will be queued and eventually transformed when visited\n return;\n } else {\n ref = scope.generateUidIdentifierBasedOnNode(node.left);\n scope.push({ id: t.cloneNode(ref) });\n assignment = t.assignmentExpression(\"=\", ref, node.left);\n }\n\n path.replaceWith(\n t.conditionalExpression(\n // We cannot use `!= null` in spec mode because\n // `document.all == null` and `document.all` is not \"nullish\".\n noDocumentAll\n ? t.binaryExpression(\"!=\", assignment, t.nullLiteral())\n : t.logicalExpression(\n \"&&\",\n t.binaryExpression(\"!==\", assignment, t.nullLiteral()),\n t.binaryExpression(\n \"!==\",\n t.cloneNode(ref),\n scope.buildUndefinedNode(),\n ),\n ),\n t.cloneNode(ref),\n node.right,\n ),\n );\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAmD,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMpC,IAAAC,0BAAO,EAAC,CAACC,GAAG,EAAE;EAAEC,KAAK,GAAG;AAAe,CAAC,KAAK;EAAA,IAAAC,eAAA,EAAAC,gBAAA;EAC1DH,GAAG,CAACI,aAAa,uCAAoB,CAAC;EACtC,MAAMC,aAAa,IAAAH,eAAA,GAAGF,GAAG,CAACM,UAAU,CAAC,eAAe,CAAC,YAAAJ,eAAA,GAAID,KAAK;EAC9D,MAAMM,WAAW,IAAAJ,gBAAA,GAAGH,GAAG,CAACM,UAAU,CAAC,aAAa,CAAC,YAAAH,gBAAA,GAAI,KAAK;EAE1D,OAAO;IACLK,IAAI,EAAE,uCAAuC;IAC7CC,iBAAiB,EAEbA,CAACC,CAAC,EAAEC,MAAM,KAAKA,MAAM,CAACC,OAAO,CAACC,IAAI,CAAC,2BAA2B,CAAC;IAEnEC,OAAO,EAAE;MACPC,iBAAiBA,CAACC,IAAI,EAAE;QACtB,MAAM;UAAEC,IAAI;UAAEC;QAAM,CAAC,GAAGF,IAAI;QAC5B,IAAIC,IAAI,CAACE,QAA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AI,EAAEnB,UAAU,EAAEE,WAAC,CAACkB,WAAW,CAAC,CAAC,CAAC,GACrDlB,WAAC,CAACmB,iBAAiB,CACjB,IAAI,EACJnB,WAAC,CAACiB,gBAAgB,CAAC,KAAK,EAAEnB,UAAU,EAAEE,WAAC,CAACkB,WAAW,CAAC,CAAC,CAAC,EACtDlB,WAAC,CAACiB,gBAAgB,CAChB,KAAK,EACLjB,WAAC,CAACQ,SAAS,CAACX,GAAG,CAAC,EAChBF,KAAK,CAACyB,kBAAkB,CAAC,CAC3B,CACF,CAAC,EACLpB,WAAC,CAACQ,SAAS,CAACX,GAAG,CAAC,EAChBH,IAAI,CAAC2B,KACP,CACF,CAAC;MACH;IACF;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator/package.json b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator/package.json deleted file mode 100644 index ecdd656e..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "@babel/plugin-transform-nullish-coalescing-operator", - "version": "7.27.1", - "description": "Remove nullish coalescing operator", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-plugin-transform-nullish-coalescing-operator" - }, - "homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-nullish-coalescing-operator", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "main": "./lib/index.js", - "keywords": [ - "babel-plugin" - ], - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - }, - "devDependencies": { - "@babel/core": "^7.27.1", - "@babel/helper-plugin-test-runner": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "author": "The Babel Team (https://babel.dev/team)", - "type": "commonjs" -} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining/LICENSE b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining/LICENSE deleted file mode 100644 index f31575ec..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining/README.md b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining/README.md deleted file mode 100644 index 41cdc2b6..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/plugin-transform-optional-chaining - -> Transform optional chaining operators into a series of nil checks - -See our website [@babel/plugin-transform-optional-chaining](https://babeljs.io/docs/babel-plugin-transform-optional-chaining) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/plugin-transform-optional-chaining -``` - -or using yarn: - -```sh -yarn add @babel/plugin-transform-optional-chaining --dev -``` diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining/lib/index.js b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining/lib/index.js deleted file mode 100644 index d8ee7ddb..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining/lib/index.js +++ /dev/null @@ -1,243 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var helperPluginUtils = require('@babel/helper-plugin-utils'); -var core = require('@babel/core'); -var helperSkipTransparentExpressionWrappers = require('@babel/helper-skip-transparent-expression-wrappers'); - -function willPathCastToBoolean(path) { - const maybeWrapped = findOutermostTransparentParent(path); - const { - node, - parentPath - } = maybeWrapped; - if (parentPath.isLogicalExpression()) { - const { - operator, - right - } = parentPath.node; - if (operator === "&&" || operator === "||" || operator === "??" && node === right) { - return willPathCastToBoolean(parentPath); - } - } - if (parentPath.isSequenceExpression()) { - const { - expressions - } = parentPath.node; - if (expressions[expressions.length - 1] === node) { - return willPathCastToBoolean(parentPath); - } else { - return true; - } - } - return parentPath.isConditional({ - test: node - }) || parentPath.isUnaryExpression({ - operator: "!" - }) || parentPath.isLoop({ - test: node - }); -} -function findOutermostTransparentParent(path) { - let maybeWrapped = path; - path.findParent(p => { - if (!helperSkipTransparentExpressionWrappers.isTransparentExprWrapper(p.node)) return true; - maybeWrapped = p; - }); - return maybeWrapped; -} - -const last = arr => arr[arr.length - 1]; -function isSimpleMemberExpression(expression) { - expression = helperSkipTransparentExpressionWrappers.skipTransparentExprWrapperNodes(expression); - return core.types.isIdentifier(expression) || core.types.isSuper(expression) || core.types.isMemberExpression(expression) && !expression.computed && isSimpleMemberExpression(expression.object); -} -function needsMemoize(path) { - let optionalPath = path; - const { - scope - } = path; - while (optionalPath.isOptionalMemberExpression() || optionalPath.isOptionalCallExpression()) { - const { - node - } = optionalPath; - const childPath = helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers(optionalPath.isOptionalMemberExpression() ? optionalPath.get("object") : optionalPath.get("callee")); - if (node.optional) { - return !scope.isStatic(childPath.node); - } - optionalPath = childPath; - } -} -const NULLISH_CHECK = core.template.expression(`%%check%% === null || %%ref%% === void 0`); -const NULLISH_CHECK_NO_DDA = core.template.expression(`%%check%% == null`); -const NULLISH_CHECK_NEG = core.template.expression(`%%check%% !== null && %%ref%% !== void 0`); -const NULLISH_CHECK_NO_DDA_NEG = core.template.expression(`%%check%% != null`); -function transformOptionalChain(path, { - pureGetters, - noDocumentAll -}, replacementPath, ifNullish, wrapLast) { - const { - scope - } = path; - if (scope.path.isPattern() && needsMemoize(path)) { - replacementPath.replaceWith(core.template.expression.ast`(() => ${replacementPath.node})()`); - return; - } - const optionals = []; - let optionalPath = path; - while (optionalPath.isOptionalMemberExpression() || optionalPath.isOptionalCallExpression()) { - const { - node - } = optionalPath; - if (node.optional) { - optionals.push(node); - } - if (optionalPath.isOptionalMemberExpression()) { - optionalPath.node.type = "MemberExpression"; - optionalPath = helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers(optionalPath.get("object")); - } else if (optionalPath.isOptionalCallExpression()) { - optionalPath.node.type = "CallExpression"; - optionalPath = helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers(optionalPath.get("callee")); - } - } - if (optionals.length === 0) { - return; - } - const checks = []; - let tmpVar; - for (let i = optionals.length - 1; i >= 0; i--) { - const node = optionals[i]; - const isCall = core.types.isCallExpression(node); - const chainWithTypes = isCall ? node.callee : node.object; - const chain = helperSkipTransparentExpressionWrappers.skipTransparentExprWrapperNodes(chainWithTypes); - let ref; - let check; - if (isCall && core.types.isIdentifier(chain, { - name: "eval" - })) { - check = ref = chain; - node.callee = core.types.sequenceExpression([core.types.numericLiteral(0), ref]); - } else if (pureGetters && isCall && isSimpleMemberExpression(chain)) { - check = ref = node.callee; - } else if (scope.isStatic(chain)) { - check = ref = chainWithTypes; - } else { - if (!tmpVar || isCall) { - tmpVar = scope.generateUidIdentifierBasedOnNode(chain); - scope.push({ - id: core.types.cloneNode(tmpVar) - }); - } - ref = tmpVar; - check = core.types.assignmentExpression("=", core.types.cloneNode(tmpVar), chainWithTypes); - if (isCall) { - node.callee = ref; - } else { - node.object = ref; - } - } - if (isCall && core.types.isMemberExpression(chain)) { - if (pureGetters && isSimpleMemberExpression(chain)) { - node.callee = chainWithTypes; - } else { - const { - object - } = chain; - let context; - if (core.types.isSuper(object)) { - context = core.types.thisExpression(); - } else { - const memoized = scope.maybeGenerateMemoised(object); - if (memoized) { - context = memoized; - chain.object = core.types.assignmentExpression("=", memoized, object); - } else { - context = object; - } - } - node.arguments.unshift(core.types.cloneNode(context)); - node.callee = core.types.memberExpression(node.callee, core.types.identifier("call")); - } - } - const data = { - check: core.types.cloneNode(check), - ref: core.types.cloneNode(ref) - }; - Object.defineProperty(data, "ref", { - enumerable: false - }); - checks.push(data); - } - let result = replacementPath.node; - if (wrapLast) result = wrapLast(result); - const ifNullishBoolean = core.types.isBooleanLiteral(ifNullish); - const ifNullishFalse = ifNullishBoolean && ifNullish.value === false; - const ifNullishVoid = !ifNullishBoolean && core.types.isUnaryExpression(ifNullish, { - operator: "void" - }); - const isEvaluationValueIgnored = core.types.isExpressionStatement(replacementPath.parent) && !replacementPath.isCompletionRecord() || core.types.isSequenceExpression(replacementPath.parent) && last(replacementPath.parent.expressions) !== replacementPath.node; - const tpl = ifNullishFalse ? noDocumentAll ? NULLISH_CHECK_NO_DDA_NEG : NULLISH_CHECK_NEG : noDocumentAll ? NULLISH_CHECK_NO_DDA : NULLISH_CHECK; - const logicalOp = ifNullishFalse ? "&&" : "||"; - const check = checks.map(tpl).reduce((expr, check) => core.types.logicalExpression(logicalOp, expr, check)); - replacementPath.replaceWith(ifNullishBoolean || ifNullishVoid && isEvaluationValueIgnored ? core.types.logicalExpression(logicalOp, check, result) : core.types.conditionalExpression(check, ifNullish, result)); -} -function transform(path, assumptions) { - const { - scope - } = path; - const maybeWrapped = findOutermostTransparentParent(path); - const { - parentPath - } = maybeWrapped; - if (parentPath.isUnaryExpression({ - operator: "delete" - })) { - transformOptionalChain(path, assumptions, parentPath, core.types.booleanLiteral(true)); - } else { - let wrapLast; - if (parentPath.isCallExpression({ - callee: maybeWrapped.node - }) && path.isOptionalMemberExpression()) { - wrapLast = replacement => { - const object = helperSkipTransparentExpressionWrappers.skipTransparentExprWrapperNodes(replacement.object); - let baseRef; - if (!assumptions.pureGetters || !isSimpleMemberExpression(object)) { - baseRef = scope.maybeGenerateMemoised(object); - if (baseRef) { - replacement.object = core.types.assignmentExpression("=", baseRef, object); - } - } - return core.types.callExpression(core.types.memberExpression(replacement, core.types.identifier("bind")), [core.types.cloneNode(baseRef != null ? baseRef : object)]); - }; - } - transformOptionalChain(path, assumptions, path, willPathCastToBoolean(maybeWrapped) ? core.types.booleanLiteral(false) : scope.buildUndefinedNode(), wrapLast); - } -} - -var index = helperPluginUtils.declare((api, options) => { - var _api$assumption, _api$assumption2; - api.assertVersion("^7.0.0-0 || >8.0.0-alpha <8.0.0-beta"); - const { - loose = false - } = options; - const noDocumentAll = (_api$assumption = api.assumption("noDocumentAll")) != null ? _api$assumption : loose; - const pureGetters = (_api$assumption2 = api.assumption("pureGetters")) != null ? _api$assumption2 : loose; - return { - name: "transform-optional-chaining", - manipulateOptions: (_, parser) => parser.plugins.push("optionalChaining"), - visitor: { - "OptionalCallExpression|OptionalMemberExpression"(path) { - transform(path, { - noDocumentAll, - pureGetters - }); - } - } - }; -}); - -exports.default = index; -exports.transform = transform; -exports.transformOptionalChain = transformOptionalChain; -//# sourceMappingURL=index.js.map diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining/lib/index.js.map b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining/lib/index.js.map deleted file mode 100644 index 74386d7e..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../src/util.ts","../src/transform.ts","../src/index.ts"],"sourcesContent":["import type { NodePath } from \"@babel/core\";\nimport { isTransparentExprWrapper } from \"@babel/helper-skip-transparent-expression-wrappers\";\n/**\n * Test if a NodePath will be cast to boolean when evaluated.\n * It respects transparent expression wrappers defined in\n * \"@babel/helper-skip-transparent-expression-wrappers\"\n *\n * @example\n * // returns true\n * const nodePathADotB = NodePath(\"if (a.b) {}\").get(\"test\"); // a.b\n * willPathCastToBoolean(nodePathADotB)\n * @example\n * // returns false\n * willPathCastToBoolean(NodePath(\"a.b\"))\n * @param {NodePath} path\n * @returns {boolean}\n */\nexport function willPathCastToBoolean(path: NodePath): boolean {\n const maybeWrapped = findOutermostTransparentParent(path);\n const { node, parentPath } = maybeWrapped;\n if (parentPath.isLogicalExpression()) {\n const { operator, right } = parentPath.node;\n if (\n operator === \"&&\" ||\n operator === \"||\" ||\n (operator === \"??\" && node === right)\n ) {\n return willPathCastToBoolean(parentPath);\n }\n }\n if (parentPath.isSequenceExpression()) {\n const { expressions } = parentPath.node;\n if (expressions[expressions.length - 1] === node) {\n return willPathCastToBoolean(parentPath);\n } else {\n // if it is in the middle of a sequence expression, we don't\n // care the return value so just cast to boolean for smaller\n // output\n return true;\n }\n }\n return (\n parentPath.isConditional({ test: node }) ||\n parentPath.isUnaryExpression({ operator: \"!\" }) ||\n parentPath.isLoop({ test: node })\n );\n}\n\n/**\n * Return the outermost transparent expression wrapper of a given path,\n * otherwise returns path itself.\n * @example\n * const nodePathADotB = NodePath(\"(a.b as any)\").get(\"expression\"); // a.b\n * // returns NodePath(\"(a.b as any)\")\n * findOutermostTransparentParent(nodePathADotB);\n * @param {NodePath} path\n * @returns {NodePath}\n */\nexport function findOutermostTransparentParent(path: NodePath): NodePath {\n let maybeWrapped = path;\n path.findParent(p => {\n if (!isTransparentExprWrapper(p.node)) return true;\n maybeWrapped = p;\n });\n return maybeWrapped;\n}\n","import { types as t, template, type NodePath } from \"@babel/core\";\nimport {\n skipTransparentExprWrapperNodes,\n skipTransparentExprWrappers,\n} from \"@babel/helper-skip-transparent-expression-wrappers\";\nimport {\n willPathCastToBoolean,\n findOutermostTransparentParent,\n} from \"./util.ts\";\n\n// TODO(Babel 9): Use .at(-1)\nconst last = (arr: T[]) => arr[arr.length - 1];\n\nfunction isSimpleMemberExpression(\n expression: t.Expression | t.Super,\n): expression is t.Identifier | t.Super | t.MemberExpression {\n expression = skipTransparentExprWrapperNodes(expression);\n return (\n t.isIdentifier(expression) ||\n t.isSuper(expression) ||\n (t.isMemberExpression(expression) &&\n !expression.computed &&\n isSimpleMemberExpression(expression.object))\n );\n}\n\n/**\n * Test if a given optional chain `path` needs to be memoized\n * @param {NodePath} path\n * @returns {boolean}\n */\nfunction needsMemoize(\n path: NodePath,\n) {\n let optionalPath: NodePath = path;\n const { scope } = path;\n while (\n optionalPath.isOptionalMemberExpression() ||\n optionalPath.isOptionalCallExpression()\n ) {\n const { node } = optionalPath;\n const childPath = skipTransparentExprWrappers(\n optionalPath.isOptionalMemberExpression()\n ? optionalPath.get(\"object\")\n : optionalPath.get(\"callee\"),\n );\n if (node.optional) {\n return !scope.isStatic(childPath.node);\n }\n\n optionalPath = childPath;\n }\n}\n\nconst NULLISH_CHECK = template.expression(\n `%%check%% === null || %%ref%% === void 0`,\n);\nconst NULLISH_CHECK_NO_DDA = template.expression(`%%check%% == null`);\nconst NULLISH_CHECK_NEG = template.expression(\n `%%check%% !== null && %%ref%% !== void 0`,\n);\nconst NULLISH_CHECK_NO_DDA_NEG = template.expression(`%%check%% != null`);\n\ninterface OptionalChainAssumptions {\n pureGetters: boolean;\n noDocumentAll: boolean;\n}\n\nexport function transformOptionalChain(\n path: NodePath,\n { pureGetters, noDocumentAll }: OptionalChainAssumptions,\n replacementPath: NodePath,\n ifNullish: t.Expression,\n wrapLast?: (value: t.Expression) => t.Expression,\n) {\n const { scope } = path;\n\n // Replace `function (a, x = a.b?.c) {}` to `function (a, x = (() => a.b?.c)() ){}`\n // so the temporary variable can be injected in correct scope\n if (scope.path.isPattern() && needsMemoize(path)) {\n replacementPath.replaceWith(\n template.expression.ast`(() => ${replacementPath.node})()`,\n );\n // The injected optional chain will be queued and eventually transformed when visited\n return;\n }\n\n const optionals = [];\n\n let optionalPath = path;\n while (\n optionalPath.isOptionalMemberExpression() ||\n optionalPath.isOptionalCallExpression()\n ) {\n const { node } = optionalPath;\n if (node.optional) {\n optionals.push(node);\n }\n if (optionalPath.isOptionalMemberExpression()) {\n // @ts-expect-error todo(flow->ts) avoid changing more type\n optionalPath.node.type = \"MemberExpression\";\n // @ts-expect-error todo(flow->ts)\n optionalPath = skipTransparentExprWrappers(optionalPath.get(\"object\"));\n } else if (optionalPath.isOptionalCallExpression()) {\n // @ts-expect-error todo(flow->ts) avoid changing more type\n optionalPath.node.type = \"CallExpression\";\n // @ts-expect-error todo(flow->ts)\n optionalPath = skipTransparentExprWrappers(optionalPath.get(\"callee\"));\n }\n }\n\n if (optionals.length === 0) {\n // Malformed AST: there was an OptionalMemberExpression node\n // with no actual optional elements.\n return;\n }\n\n const checks = [];\n\n let tmpVar;\n\n for (let i = optionals.length - 1; i >= 0; i--) {\n const node = optionals[i] as unknown as\n | t.MemberExpression\n | t.CallExpression;\n\n const isCall = t.isCallExpression(node);\n\n const chainWithTypes = isCall\n ? // V8 intrinsics must not be an optional call\n (node.callee as t.Expression)\n : node.object;\n const chain = skipTransparentExprWrapperNodes(chainWithTypes);\n\n let ref;\n let check;\n if (isCall && t.isIdentifier(chain, { name: \"eval\" })) {\n check = ref = chain;\n // `eval?.()` is an indirect eval call transformed to `(0,eval)()`\n node.callee = t.sequenceExpression([t.numericLiteral(0), ref]);\n } else if (pureGetters && isCall && isSimpleMemberExpression(chain)) {\n // If we assume getters are pure (avoiding a Function#call) and we are at the call,\n // we can avoid a needless memoize. We only do this if the callee is a simple member\n // expression, to avoid multiple calls to nested call expressions.\n check = ref = node.callee;\n } else if (scope.isStatic(chain)) {\n check = ref = chainWithTypes;\n } else {\n // We cannot reuse the tmpVar for calls, because we need to\n // store both the method and the receiver.\n if (!tmpVar || isCall) {\n tmpVar = scope.generateUidIdentifierBasedOnNode(chain);\n scope.push({ id: t.cloneNode(tmpVar) });\n }\n ref = tmpVar;\n check = t.assignmentExpression(\n \"=\",\n t.cloneNode(tmpVar),\n // Here `chainWithTypes` MUST NOT be cloned because it could be\n // updated when generating the memoised context of a call\n // expression. It must be an Expression when `ref` is an identifier\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n chainWithTypes as t.Expression,\n );\n\n if (isCall) {\n node.callee = ref;\n } else {\n node.object = ref;\n }\n }\n\n // Ensure call expressions have the proper `this`\n // `foo.bar()` has context `foo`.\n if (isCall && t.isMemberExpression(chain)) {\n if (pureGetters && isSimpleMemberExpression(chain)) {\n // To avoid a Function#call, we can instead re-grab the property from the context object.\n // `a.?b.?()` translates roughly to `_a.b != null && _a.b()`\n node.callee = chainWithTypes;\n } else {\n // Otherwise, we need to memoize the context object, and change the call into a Function#call.\n // `a.?b.?()` translates roughly to `(_b = _a.b) != null && _b.call(_a)`\n const { object } = chain;\n let context: t.Expression;\n if (t.isSuper(object)) {\n context = t.thisExpression();\n } else {\n const memoized = scope.maybeGenerateMemoised(object);\n if (memoized) {\n context = memoized;\n chain.object = t.assignmentExpression(\"=\", memoized, object);\n } else {\n context = object;\n }\n }\n\n node.arguments.unshift(t.cloneNode(context));\n // @ts-expect-error node.callee can not be an V8IntrinsicIdentifier: V8 intrinsic is disallowed in optional chain\n node.callee = t.memberExpression(node.callee, t.identifier(\"call\"));\n }\n }\n\n const data = { check: t.cloneNode(check), ref: t.cloneNode(ref) };\n // We make `ref` non-enumerable, so that @babel/template doesn't throw\n // in the noDocumentAll template if it's not used.\n Object.defineProperty(data, \"ref\", { enumerable: false });\n checks.push(data);\n }\n\n let result = replacementPath.node;\n if (wrapLast) result = wrapLast(result);\n\n const ifNullishBoolean = t.isBooleanLiteral(ifNullish);\n const ifNullishFalse = ifNullishBoolean && ifNullish.value === false;\n const ifNullishVoid =\n !ifNullishBoolean && t.isUnaryExpression(ifNullish, { operator: \"void\" });\n\n const isEvaluationValueIgnored =\n (t.isExpressionStatement(replacementPath.parent) &&\n !replacementPath.isCompletionRecord()) ||\n (t.isSequenceExpression(replacementPath.parent) &&\n last(replacementPath.parent.expressions) !== replacementPath.node);\n\n // prettier-ignore\n const tpl = ifNullishFalse\n ? (noDocumentAll ? NULLISH_CHECK_NO_DDA_NEG : NULLISH_CHECK_NEG)\n : (noDocumentAll ? NULLISH_CHECK_NO_DDA : NULLISH_CHECK);\n const logicalOp = ifNullishFalse ? \"&&\" : \"||\";\n\n const check = checks\n .map(tpl)\n .reduce((expr, check) => t.logicalExpression(logicalOp, expr, check));\n\n replacementPath.replaceWith(\n ifNullishBoolean || (ifNullishVoid && isEvaluationValueIgnored)\n ? t.logicalExpression(logicalOp, check, result)\n : t.conditionalExpression(check, ifNullish, result),\n );\n}\n\nexport function transform(\n path: NodePath,\n assumptions: OptionalChainAssumptions,\n) {\n const { scope } = path;\n\n // maybeWrapped points to the outermost transparent expression wrapper\n // or the path itself\n const maybeWrapped = findOutermostTransparentParent(path);\n const { parentPath } = maybeWrapped;\n\n if (parentPath.isUnaryExpression({ operator: \"delete\" })) {\n transformOptionalChain(\n path,\n assumptions,\n parentPath,\n t.booleanLiteral(true),\n );\n } else {\n let wrapLast;\n if (\n parentPath.isCallExpression({ callee: maybeWrapped.node }) &&\n // note that the first condition must implies that `path.optional` is `true`,\n // otherwise the parentPath should be an OptionalCallExpression\n path.isOptionalMemberExpression()\n ) {\n // Ensure (a?.b)() has proper `this`\n wrapLast = (replacement: t.MemberExpression) => {\n // `(a?.b)()` to `(a == null ? undefined : a.b.bind(a))()`\n // object must not be Super as super?.foo is invalid\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const object = skipTransparentExprWrapperNodes(\n replacement.object,\n ) as t.Expression;\n let baseRef: t.Expression;\n if (!assumptions.pureGetters || !isSimpleMemberExpression(object)) {\n // memoize the context object when getters are not always pure\n // or the object is not a simple member expression\n // `(a?.b.c)()` to `(a == null ? undefined : (_a$b = a.b).c.bind(_a$b))()`\n baseRef = scope.maybeGenerateMemoised(object);\n if (baseRef) {\n replacement.object = t.assignmentExpression(\"=\", baseRef, object);\n }\n }\n return t.callExpression(\n t.memberExpression(replacement, t.identifier(\"bind\")),\n [t.cloneNode(baseRef ?? object)],\n );\n };\n }\n\n transformOptionalChain(\n path,\n assumptions,\n path,\n willPathCastToBoolean(maybeWrapped)\n ? t.booleanLiteral(false)\n : scope.buildUndefinedNode(),\n wrapLast,\n );\n }\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { transform, transformOptionalChain } from \"./transform.ts\";\nimport type { NodePath, types as t } from \"@babel/core\";\n\nexport interface Options {\n loose?: boolean;\n}\nexport default declare((api, options: Options) => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n const { loose = false } = options;\n const noDocumentAll = api.assumption(\"noDocumentAll\") ?? loose;\n const pureGetters = api.assumption(\"pureGetters\") ?? loose;\n\n return {\n name: \"transform-optional-chaining\",\n manipulateOptions: process.env.BABEL_8_BREAKING\n ? undefined\n : (_, parser) => parser.plugins.push(\"optionalChaining\"),\n\n visitor: {\n \"OptionalCallExpression|OptionalMemberExpression\"(\n path: NodePath,\n ) {\n transform(path, { noDocumentAll, pureGetters });\n },\n },\n };\n});\n\nexport { transform, transformOptionalChain };\n"],"names":["willPathCastToBoolean","path","maybeWrapped","findOutermostTransparentParent","node","parentPath","isLogicalExpression","operator","right","isSequenceExpression","expressions","length","isConditional","test","isUnaryExpression","isLoop","findParent","p","isTransparentExprWrapper","last","arr","isSimpleMemberExpression","expression","skipTransparentExprWrapperNodes","t","isIdentifier","isSuper","isMemberExpression","computed","object","needsMemoize","optionalPath","scope","isOptionalMemberExpression","isOptionalCallExpression","childPath","skipTransparentExprWrappers","get","optional","isStatic","NULLISH_CHECK","template","NULLISH_CHECK_NO_DDA","NULLISH_CHECK_NEG","NULLISH_CHECK_NO_DDA_NEG","transformOptionalChain","pureGetters","noDocumentAll","replacementPath","ifNullish","wrapLast","isPattern","replaceWith","ast","optionals","push","type","checks","tmpVar","i","isCall","isCallExpression","chainWithTypes","callee","chain","ref","check","name","sequenceExpression","numericLiteral","generateUidIdentifierBasedOnNode","id","cloneNode","assignmentExpression","context","thisExpression","memoized","maybeGenerateMemoised","arguments","unshift","memberExpression","identifier","data","Object","defineProperty","enumerable","result","ifNullishBoolean","isBooleanLiteral","ifNullishFalse","value","ifNullishVoid","isEvaluationValueIgnored","isExpressionStatement","parent","isCompletionRecord","tpl","logicalOp","map","reduce","expr","logicalExpression","conditionalExpression","transform","assumptions","booleanLiteral","replacement","baseRef","callExpression","buildUndefinedNode","declare","api","options","_api$assumption","_api$assumption2","assertVersion","loose","assumption","manipulateOptions","_","parser","plugins","visitor","OptionalCallExpression|OptionalMemberExpression"],"mappings":";;;;;;;;AAiBO,SAASA,qBAAqBA,CAACC,IAAc,EAAW;AAC7D,EAAA,MAAMC,YAAY,GAAGC,8BAA8B,CAACF,IAAI,CAAC,CAAA;EACzD,MAAM;IAAEG,IAAI;AAAEC,IAAAA,UAAAA;AAAW,GAAC,GAAGH,YAAY,CAAA;AACzC,EAAA,IAAIG,UAAU,CAACC,mBAAmB,EAAE,EAAE;IACpC,MAAM;MAAEC,QAAQ;AAAEC,MAAAA,KAAAA;KAAO,GAAGH,UAAU,CAACD,IAAI,CAAA;AAC3C,IAAA,IACEG,QAAQ,KAAK,IAAI,IACjBA,QAAQ,KAAK,IAAI,IAChBA,QAAQ,KAAK,IAAI,IAAIH,IAAI,KAAKI,KAAM,EACrC;MACA,OAAOR,qBAAqB,CAACK,UAAU,CAAC,CAAA;AAC1C,KAAA;AACF,GAAA;AACA,EAAA,IAAIA,UAAU,CAACI,oBAAoB,EAAE,EA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EAAE,EAC9B3D,QACF,CAAC,CAAA;AACH,GAAA;AACF;;ACtSA,YAAe4D,yBAAO,CAAC,CAACC,GAAG,EAAEC,OAAgB,KAAK;EAAA,IAAAC,eAAA,EAAAC,gBAAA,CAAA;EAChDH,GAAG,CAACI,aAAa,CAAA,sCAAoB,CAAC,CAAA;EAEtC,MAAM;AAAEC,IAAAA,KAAK,GAAG,KAAA;AAAM,GAAC,GAAGJ,OAAO,CAAA;AACjC,EAAA,MAAMjE,aAAa,GAAA,CAAAkE,eAAA,GAAGF,GAAG,CAACM,UAAU,CAAC,eAAe,CAAC,KAAAJ,IAAAA,GAAAA,eAAA,GAAIG,KAAK,CAAA;AAC9D,EAAA,MAAMtE,WAAW,GAAA,CAAAoE,gBAAA,GAAGH,GAAG,CAACM,UAAU,CAAC,aAAa,CAAC,KAAAH,IAAAA,GAAAA,gBAAA,GAAIE,KAAK,CAAA;EAE1D,OAAO;AACLjD,IAAAA,IAAI,EAAE,6BAA6B;AACnCmD,IAAAA,iBAAiB,EAEbA,CAACC,CAAC,EAAEC,MAAM,KAAKA,MAAM,CAACC,OAAO,CAAClE,IAAI,CAAC,kBAAkB,CAAC;AAE1DmE,IAAAA,OAAO,EAAE;MACP,iDAAiDC,CAC/C1H,IAAqE,EACrE;QACAsG,SAAS,CAACtG,IAAI,EAAE;UAAE8C,aAAa;AAAED,UAAAA,WAAAA;AAAY,SAAC,CAAC,CAAA;AACjD,OAAA;AACF,KAAA;GACD,CAAA;AACH,CAAC,CAAC;;;;;;"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining/package.json b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining/package.json deleted file mode 100644 index 9e2e3e35..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@babel/plugin-transform-optional-chaining", - "version": "7.27.1", - "description": "Transform optional chaining operators into a series of nil checks", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-plugin-transform-optional-chaining" - }, - "homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-optional-chaining", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "main": "./lib/index.js", - "keywords": [ - "babel-plugin" - ], - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1", - "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - }, - "devDependencies": { - "@babel/core": "^7.27.1", - "@babel/helper-plugin-test-runner": "^7.27.1", - "@babel/plugin-transform-block-scoping": "^7.27.1", - "@babel/traverse": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "author": "The Babel Team (https://babel.dev/team)", - "type": "commonjs" -} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/preset-typescript/LICENSE b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/preset-typescript/LICENSE deleted file mode 100644 index f31575ec..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/preset-typescript/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/preset-typescript/README.md b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/preset-typescript/README.md deleted file mode 100644 index 247820ec..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/preset-typescript/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/preset-typescript - -> Babel preset for TypeScript. - -See our website [@babel/preset-typescript](https://babeljs.io/docs/babel-preset-typescript) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22area%3A%20typescript%22+is%3Aopen) associated with this package. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/preset-typescript -``` - -or using yarn: - -```sh -yarn add @babel/preset-typescript --dev -``` diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/preset-typescript/lib/index.js b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/preset-typescript/lib/index.js deleted file mode 100644 index 1ca507a9..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/preset-typescript/lib/index.js +++ /dev/null @@ -1,167 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var helperPluginUtils = require('@babel/helper-plugin-utils'); -var transformTypeScript = require('@babel/plugin-transform-typescript'); -require('@babel/plugin-syntax-jsx'); -var transformModulesCommonJS = require('@babel/plugin-transform-modules-commonjs'); -var helperValidatorOption = require('@babel/helper-validator-option'); - -function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } - -var transformTypeScript__default = /*#__PURE__*/_interopDefault(transformTypeScript); -var transformModulesCommonJS__default = /*#__PURE__*/_interopDefault(transformModulesCommonJS); - -const v = new helperValidatorOption.OptionValidator("@babel/preset-typescript"); -function normalizeOptions(options = {}) { - let { - allowNamespaces = true, - jsxPragma, - onlyRemoveTypeImports - } = options; - const TopLevelOptions = { - ignoreExtensions: "ignoreExtensions", - allowNamespaces: "allowNamespaces", - disallowAmbiguousJSXLike: "disallowAmbiguousJSXLike", - jsxPragma: "jsxPragma", - jsxPragmaFrag: "jsxPragmaFrag", - onlyRemoveTypeImports: "onlyRemoveTypeImports", - optimizeConstEnums: "optimizeConstEnums", - rewriteImportExtensions: "rewriteImportExtensions", - allExtensions: "allExtensions", - isTSX: "isTSX" - }; - const jsxPragmaFrag = v.validateStringOption(TopLevelOptions.jsxPragmaFrag, options.jsxPragmaFrag, "React.Fragment"); - { - var allExtensions = v.validateBooleanOption(TopLevelOptions.allExtensions, options.allExtensions, false); - var isTSX = v.validateBooleanOption(TopLevelOptions.isTSX, options.isTSX, false); - if (isTSX) { - v.invariant(allExtensions, "isTSX:true requires allExtensions:true"); - } - } - const ignoreExtensions = v.validateBooleanOption(TopLevelOptions.ignoreExtensions, options.ignoreExtensions, false); - const disallowAmbiguousJSXLike = v.validateBooleanOption(TopLevelOptions.disallowAmbiguousJSXLike, options.disallowAmbiguousJSXLike, false); - if (disallowAmbiguousJSXLike) { - { - v.invariant(allExtensions, "disallowAmbiguousJSXLike:true requires allExtensions:true"); - } - } - const optimizeConstEnums = v.validateBooleanOption(TopLevelOptions.optimizeConstEnums, options.optimizeConstEnums, false); - const rewriteImportExtensions = v.validateBooleanOption(TopLevelOptions.rewriteImportExtensions, options.rewriteImportExtensions, false); - const normalized = { - ignoreExtensions, - allowNamespaces, - disallowAmbiguousJSXLike, - jsxPragma, - jsxPragmaFrag, - onlyRemoveTypeImports, - optimizeConstEnums, - rewriteImportExtensions - }; - { - normalized.allExtensions = allExtensions; - normalized.isTSX = isTSX; - } - return normalized; -} - -var pluginRewriteTSImports = helperPluginUtils.declare(function ({ - types: t, - template -}) { - function maybeReplace(source, path, state) { - if (!source) return; - if (t.isStringLiteral(source)) { - if (/^\.\.?\//.test(source.value)) { - source.value = source.value.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { - return tsx ? ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; - }); - } - return; - } - if (state.availableHelper("tsRewriteRelativeImportExtensions")) { - path.replaceWith(t.callExpression(state.addHelper("tsRewriteRelativeImportExtensions"), [source])); - } else { - path.replaceWith(template.expression.ast`(${source} + "").replace(/([\\/].*\.[mc]?)tsx?$/, "$1js")`); - } - } - return { - name: "preset-typescript/plugin-rewrite-ts-imports", - visitor: { - "ImportDeclaration|ExportAllDeclaration|ExportNamedDeclaration"(path, state) { - const node = path.node; - const kind = t.isImportDeclaration(node) ? node.importKind : node.exportKind; - if (kind === "value") { - maybeReplace(node.source, path.get("source"), state); - } - }, - CallExpression(path, state) { - if (t.isImport(path.node.callee)) { - maybeReplace(path.node.arguments[0], path.get("arguments.0"), state); - } - }, - ImportExpression(path, state) { - maybeReplace(path.node.source, path.get("source"), state); - } - } - }; -}); - -var index = helperPluginUtils.declarePreset((api, opts) => { - api.assertVersion(7); - const { - allExtensions, - ignoreExtensions, - allowNamespaces, - disallowAmbiguousJSXLike, - isTSX, - jsxPragma, - jsxPragmaFrag, - onlyRemoveTypeImports, - optimizeConstEnums, - rewriteImportExtensions - } = normalizeOptions(opts); - const pluginOptions = disallowAmbiguousJSXLike => ({ - allowDeclareFields: opts.allowDeclareFields, - allowNamespaces, - disallowAmbiguousJSXLike, - jsxPragma, - jsxPragmaFrag, - onlyRemoveTypeImports, - optimizeConstEnums - }); - const getPlugins = (isTSX, disallowAmbiguousJSXLike) => { - { - return [[transformTypeScript__default.default, Object.assign({ - isTSX - }, pluginOptions(disallowAmbiguousJSXLike))]]; - } - }; - const disableExtensionDetect = allExtensions || ignoreExtensions; - return { - plugins: rewriteImportExtensions ? [pluginRewriteTSImports] : [], - overrides: disableExtensionDetect ? [{ - plugins: getPlugins(isTSX, disallowAmbiguousJSXLike) - }] : [{ - test: /\.ts$/, - plugins: getPlugins(false, false) - }, { - test: /\.mts$/, - sourceType: "module", - plugins: getPlugins(false, true) - }, { - test: /\.cts$/, - sourceType: "unambiguous", - plugins: [[transformModulesCommonJS__default.default, { - allowTopLevelThis: true - }], [transformTypeScript__default.default, pluginOptions(true)]] - }, { - test: /\.tsx$/, - plugins: getPlugins(true, false) - }] - }; -}); - -exports.default = index; -//# sourceMappingURL=index.js.map diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/preset-typescript/lib/index.js.map b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/preset-typescript/lib/index.js.map deleted file mode 100644 index e0320e45..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/preset-typescript/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../src/normalize-options.ts","../src/plugin-rewrite-ts-imports.ts","../src/index.ts"],"sourcesContent":["import { OptionValidator } from \"@babel/helper-validator-option\";\nconst v = new OptionValidator(\"@babel/preset-typescript\");\n\nexport interface Options {\n ignoreExtensions?: boolean;\n allowDeclareFields?: boolean;\n allowNamespaces?: boolean;\n disallowAmbiguousJSXLike?: boolean;\n jsxPragma?: string;\n jsxPragmaFrag?: string;\n onlyRemoveTypeImports?: boolean;\n optimizeConstEnums?: boolean;\n rewriteImportExtensions?: boolean;\n\n // TODO: Remove in Babel 8\n allExtensions?: boolean;\n isTSX?: boolean;\n}\n\nexport default function normalizeOptions(options: Options = {}) {\n let { allowNamespaces = true, jsxPragma, onlyRemoveTypeImports } = options;\n\n const TopLevelOptions: {\n [Key in keyof Omit]-?: Key;\n } = {\n ignoreExtensions: \"ignoreExtensions\",\n allowNamespaces: \"allowNamespaces\",\n disallowAmbiguousJSXLike: \"disallowAmbiguousJSXLike\",\n jsxPragma: \"jsxPragma\",\n jsxPragmaFrag: \"jsxPragmaFrag\",\n onlyRemoveTypeImports: \"onlyRemoveTypeImports\",\n optimizeConstEnums: \"optimizeConstEnums\",\n rewriteImportExtensions: \"rewriteImportExtensions\",\n\n // TODO: Remove in Babel 8\n allExtensions: \"allExtensions\",\n isTSX: \"isTSX\",\n };\n\n if (process.env.BABEL_8_BREAKING) {\n v.invariant(\n !(\"allowDeclareFields\" in options),\n \"The .allowDeclareFields option has been removed and it's now always enabled. Please remove it from your config.\",\n );\n v.invariant(\n !(\"allExtensions\" in options) && !(\"isTSX\" in options),\n \"The .allExtensions and .isTSX options have been removed.\\n\" +\n \"If you want to disable JSX detection based on file extensions, \" +\n \"you can set the .ignoreExtensions option to true.\\n\" +\n \"If you want to force JSX parsing, you can enable the \" +\n \"@babel/plugin-syntax-jsx plugin.\",\n );\n\n v.validateTopLevelOptions(options, TopLevelOptions);\n allowNamespaces = v.validateBooleanOption(\n TopLevelOptions.allowNamespaces,\n options.allowNamespaces,\n true,\n );\n jsxPragma = v.validateStringOption(\n TopLevelOptions.jsxPragma,\n options.jsxPragma,\n \"React\",\n );\n onlyRemoveTypeImports = v.validateBooleanOption(\n TopLevelOptions.onlyRemoveTypeImports,\n options.onlyRemoveTypeImports,\n true,\n );\n }\n\n const jsxPragmaFrag = v.validateStringOption(\n TopLevelOptions.jsxPragmaFrag,\n options.jsxPragmaFrag,\n \"React.Fragment\",\n );\n\n if (!process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var allExtensions = v.validateBooleanOption(\n TopLevelOptions.allExtensions,\n options.allExtensions,\n false,\n );\n\n // eslint-disable-next-line no-var\n var isTSX = v.validateBooleanOption(\n TopLevelOptions.isTSX,\n options.isTSX,\n false,\n );\n if (isTSX) {\n v.invariant(allExtensions, \"isTSX:true requires allExtensions:true\");\n }\n }\n\n const ignoreExtensions = v.validateBooleanOption(\n TopLevelOptions.ignoreExtensions,\n options.ignoreExtensions,\n false,\n );\n\n const disallowAmbiguousJSXLike = v.validateBooleanOption(\n TopLevelOptions.disallowAmbiguousJSXLike,\n options.disallowAmbiguousJSXLike,\n false,\n );\n if (disallowAmbiguousJSXLike) {\n if (process.env.BABEL_8_BREAKING) {\n v.invariant(\n ignoreExtensions,\n \"disallowAmbiguousJSXLike:true requires ignoreExtensions:true\",\n );\n } else {\n v.invariant(\n allExtensions,\n \"disallowAmbiguousJSXLike:true requires allExtensions:true\",\n );\n }\n }\n\n const optimizeConstEnums = v.validateBooleanOption(\n TopLevelOptions.optimizeConstEnums,\n options.optimizeConstEnums,\n false,\n );\n\n const rewriteImportExtensions = v.validateBooleanOption(\n TopLevelOptions.rewriteImportExtensions,\n options.rewriteImportExtensions,\n false,\n );\n\n const normalized: Options = {\n ignoreExtensions,\n allowNamespaces,\n disallowAmbiguousJSXLike,\n jsxPragma,\n jsxPragmaFrag,\n onlyRemoveTypeImports,\n optimizeConstEnums,\n rewriteImportExtensions,\n };\n if (!process.env.BABEL_8_BREAKING) {\n normalized.allExtensions = allExtensions;\n normalized.isTSX = isTSX;\n }\n return normalized;\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport type { types as t, NodePath, PluginPass } from \"@babel/core\";\n\nexport default declare(function ({ types: t, template }) {\n function maybeReplace(\n source: t.ArgumentPlaceholder | t.Expression,\n path: NodePath,\n state: PluginPass,\n ) {\n if (!source) return;\n // todo: if we want to support `preserveJsx`, we can register a global flag via file.set from transform-react-jsx, and read it here.\n const preserveJsx = false;\n if (t.isStringLiteral(source)) {\n if (/^\\.\\.?\\//.test(source.value)) {\n // @see packages/babel-helpers/src/helpers/tsRewriteRelativeImportExtensions.ts\n source.value = source.value.replace(\n /\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+)?)\\.([cm]?)ts$/i,\n function (m, tsx, d, ext, cm) {\n return tsx\n ? preserveJsx\n ? \".jsx\"\n : \".js\"\n : d && (!ext || !cm)\n ? m\n : d + ext + \".\" + cm.toLowerCase() + \"js\";\n },\n );\n }\n return;\n }\n\n if (\n process.env.BABEL_8_BREAKING ||\n state.availableHelper(\"tsRewriteRelativeImportExtensions\")\n ) {\n path.replaceWith(\n t.callExpression(\n state.addHelper(\"tsRewriteRelativeImportExtensions\"),\n preserveJsx ? [source, t.booleanLiteral(true)] : [source],\n ),\n );\n } else {\n path.replaceWith(\n template.expression\n .ast`(${source} + \"\").replace(/([\\\\/].*\\.[mc]?)tsx?$/, \"$1js\")`,\n );\n }\n }\n\n return {\n name: \"preset-typescript/plugin-rewrite-ts-imports\",\n visitor: {\n \"ImportDeclaration|ExportAllDeclaration|ExportNamedDeclaration\"(\n path: NodePath<\n | t.ImportDeclaration\n | t.ExportAllDeclaration\n | t.ExportNamedDeclaration\n >,\n state,\n ) {\n const node = path.node;\n const kind = t.isImportDeclaration(node)\n ? node.importKind\n : node.exportKind;\n if (kind === \"value\") {\n maybeReplace(node.source, path.get(\"source\"), state);\n }\n },\n CallExpression(path, state) {\n if (!process.env.BABEL_8_BREAKING && t.isImport(path.node.callee)) {\n maybeReplace(\n // The argument of import must not be a spread element\n path.node.arguments[0] as t.ArgumentPlaceholder | t.Expression,\n path.get(\"arguments.0\"),\n state,\n );\n }\n },\n ImportExpression(path, state) {\n maybeReplace(path.node.source, path.get(\"source\"), state);\n },\n },\n };\n});\n","import { declarePreset } from \"@babel/helper-plugin-utils\";\nimport transformTypeScript from \"@babel/plugin-transform-typescript\";\nimport syntaxJSX from \"@babel/plugin-syntax-jsx\";\nimport transformModulesCommonJS from \"@babel/plugin-transform-modules-commonjs\";\nimport normalizeOptions from \"./normalize-options.ts\";\nimport type { Options } from \"./normalize-options.ts\";\nimport pluginRewriteTSImports from \"./plugin-rewrite-ts-imports.ts\";\n\nexport default declarePreset((api, opts: Options) => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n const {\n allExtensions,\n ignoreExtensions,\n allowNamespaces,\n disallowAmbiguousJSXLike,\n isTSX,\n jsxPragma,\n jsxPragmaFrag,\n onlyRemoveTypeImports,\n optimizeConstEnums,\n rewriteImportExtensions,\n } = normalizeOptions(opts);\n\n const pluginOptions = process.env.BABEL_8_BREAKING\n ? (disallowAmbiguousJSXLike: boolean) => ({\n allowNamespaces,\n disallowAmbiguousJSXLike,\n jsxPragma,\n jsxPragmaFrag,\n onlyRemoveTypeImports,\n optimizeConstEnums,\n })\n : (disallowAmbiguousJSXLike: boolean) => ({\n allowDeclareFields: opts.allowDeclareFields,\n allowNamespaces,\n disallowAmbiguousJSXLike,\n jsxPragma,\n jsxPragmaFrag,\n onlyRemoveTypeImports,\n optimizeConstEnums,\n });\n\n const getPlugins = (isTSX: boolean, disallowAmbiguousJSXLike: boolean) => {\n if (process.env.BABEL_8_BREAKING) {\n const tsPlugin = [\n transformTypeScript,\n pluginOptions(disallowAmbiguousJSXLike),\n ];\n return isTSX ? [tsPlugin, syntaxJSX] : [tsPlugin];\n } else {\n return [\n [\n transformTypeScript,\n { isTSX, ...pluginOptions(disallowAmbiguousJSXLike) },\n ],\n ];\n }\n };\n\n const disableExtensionDetect = allExtensions || ignoreExtensions;\n\n return {\n plugins: rewriteImportExtensions ? [pluginRewriteTSImports] : [],\n overrides: disableExtensionDetect\n ? [{ plugins: getPlugins(isTSX, disallowAmbiguousJSXLike) }]\n : // Only set 'test' if explicitly requested, since it requires that\n // Babel is being called with a filename.\n [\n {\n test: !process.env.BABEL_8_BREAKING\n ? /\\.ts$/\n : filename => filename == null || filename.endsWith(\".ts\"),\n plugins: getPlugins(false, false),\n },\n {\n test: !process.env.BABEL_8_BREAKING\n ? /\\.mts$/\n : filename => filename?.endsWith(\".mts\"),\n sourceType: \"module\",\n plugins: getPlugins(false, true),\n },\n {\n test: !process.env.BABEL_8_BREAKING\n ? /\\.cts$/\n : filename => filename?.endsWith(\".cts\"),\n sourceType: \"unambiguous\",\n plugins: [\n [transformModulesCommonJS, { allowTopLevelThis: true }],\n [transformTypeScript, pluginOptions(true)],\n ],\n },\n {\n test: !process.env.BABEL_8_BREAKING\n ? /\\.tsx$/\n : filename => filename?.endsWith(\".tsx\"),\n // disallowAmbiguousJSXLike is a no-op when parsing TSX, since it's\n // always disallowed.\n plugins: getPlugins(true, false),\n },\n ],\n };\n});\n"],"names":["v","OptionValidator","normalizeOptions","options","allowNamespaces","jsxPragma","onlyRemoveTypeImports","TopLevelOptions","ignoreExtensions","disallowAmbiguousJSXLike","jsxPragmaFrag","optimizeConstEnums","rewriteImportExtensions","allExtensions","isTSX","validateStringOption","validateBooleanOption","invariant","normalized","declare","types","t","template","maybeReplace","source","path","state","isStringLiteral","test","value","replace","m","tsx","d","ext","cm","toLowerCase","availableHelper","replaceWith","callExpression","addHelper","expression","ast","name","visitor","ImportDeclaration|ExportAllDeclaration|ExportNamedDeclaration","node","kind","isImportDeclaration","importKind","exportKind","get","CallExpression","isImport","callee","arguments","ImportExpression","declarePreset","api","opts","assertVersion","pluginOptions","allowDeclareFields","getPlugins","transformTypeScript","Object","assign","disableExtensionDetect","plugins","pluginRewriteTSImports","overrides","sourceType","transformModulesCommonJS","allowTopLevelThis"],"mappings":";;;;;;;;;;;;;;;AACA,MAAMA,CAAC,GAAG,IAAIC,qCAAe,CAAC,0BAA0B,CAAC,CAAA;AAkB1C,SAASC,gBAAgBA,CAACC,OAAgB,GAAG,EAAE,EAAE;EAC9D,IAAI;AAAEC,IAAAA,eAAe,GAAG,IAAI;IAAEC,SAAS;AAAEC,IAAAA,qBAAAA;AAAsB,GAAC,GAAGH,OAAO,CAAA;AAE1E,EAAA,MAAMI,eAEL,GAAG;AACFC,IAAAA,gBAAgB,EAAE,kBAAkB;AACpCJ,IAAAA,eAAe,EAAE,iBAAiB;AAClCK,IAAAA,wBAAwB,EAAE,0BAA0B;AACpDJ,IAAAA,SAAS,EAAE,WAAW;AACtBK,IAAAA,aAAa,EAAE,eAAe;AAC9BJ,IAAAA,qBAAqB,EAAE,uBAAuB;AAC9CK,IAAAA,kBAAkB,EAAE,oBAAoB;AACxCC,IAAAA,uBAAuB,EAAE,yBAAyB;AAGlDC,IAAAA,aAAa,EAAE,eAAe;AAC9BC,IAAAA,KAAK,EAAE,OAAA;GACR,CAAA;AAkCD,EAAA,MAAMJ,aAAa,GAAGV,CAAC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;AACpBH,MAAAA,OAAO,EAAEL,UAAU,CAAC,KAAK,EAAE,IAAI,CAAA;AACjC,KAAC,EACD;AACEnC,MAAAA,IAAI,EACA,QACsC;AAC1C2C,MAAAA,UAAU,EAAE,aAAa;AACzBH,MAAAA,OAAO,EAAE,CACP,CAACI,yCAAwB,EAAE;AAAEC,QAAAA,iBAAiB,EAAE,IAAA;OAAM,CAAC,EACvD,CAACT,oCAAmB,EAAEH,aAAa,CAAC,IAAI,CAAC,CAAC,CAAA;AAE9C,KAAC,EACD;AACEjC,MAAAA,IAAI,EACA,QACsC;AAG1CwC,MAAAA,OAAO,EAAEL,UAAU,CAAC,IAAI,EAAE,KAAK,CAAA;KAChC,CAAA;GAER,CAAA;AACH,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/preset-typescript/package.json b/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/preset-typescript/package.json deleted file mode 100644 index c893431b..00000000 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/@babel/preset-typescript/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "@babel/preset-typescript", - "version": "7.27.1", - "description": "Babel preset for TypeScript.", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-preset-typescript" - }, - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "main": "./lib/index.js", - "keywords": [ - "babel-preset", - "typescript" - ], - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1", - "@babel/helper-validator-option": "^7.27.1", - "@babel/plugin-syntax-jsx": "^7.27.1", - "@babel/plugin-transform-modules-commonjs": "^7.27.1", - "@babel/plugin-transform-typescript": "^7.27.1" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - }, - "devDependencies": { - "@babel/core": "^7.27.1", - "@babel/helper-plugin-test-runner": "^7.27.1" - }, - "homepage": "https://babel.dev/docs/en/next/babel-preset-typescript", - "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22area%3A%20typescript%22+is%3Aopen", - "engines": { - "node": ">=6.9.0" - }, - "author": "The Babel Team (https://babel.dev/team)", - "type": "commonjs" -} \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/semver/classes/range.js b/frontend-admin/node_modules/react-native-worklets/node_modules/semver/classes/range.js index 94629ce6..f80c2359 100644 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/semver/classes/range.js +++ b/frontend-admin/node_modules/react-native-worklets/node_modules/semver/classes/range.js @@ -255,7 +255,6 @@ const isSatisfiable = (comparators, options) => { // already replaced the hyphen ranges // turn into a set of JUST comparators. const parseComparator = (comp, options) => { - comp = comp.replace(re[t.BUILD], '') debug('comp', comp, options) comp = replaceCarets(comp, options) debug('caret', comp) diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/semver/classes/semver.js b/frontend-admin/node_modules/react-native-worklets/node_modules/semver/classes/semver.js index 92254be1..2efba0f4 100644 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/semver/classes/semver.js +++ b/frontend-admin/node_modules/react-native-worklets/node_modules/semver/classes/semver.js @@ -111,25 +111,11 @@ class SemVer { other = new SemVer(other, this.options) } - if (this.major < other.major) { - return -1 - } - if (this.major > other.major) { - return 1 - } - if (this.minor < other.minor) { - return -1 - } - if (this.minor > other.minor) { - return 1 - } - if (this.patch < other.patch) { - return -1 - } - if (this.patch > other.patch) { - return 1 - } - return 0 + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ) } comparePre (other) { diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/semver/internal/identifiers.js b/frontend-admin/node_modules/react-native-worklets/node_modules/semver/internal/identifiers.js index d053472d..a4613dee 100644 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/semver/internal/identifiers.js +++ b/frontend-admin/node_modules/react-native-worklets/node_modules/semver/internal/identifiers.js @@ -2,10 +2,6 @@ const numeric = /^[0-9]+$/ const compareIdentifiers = (a, b) => { - if (typeof a === 'number' && typeof b === 'number') { - return a === b ? 0 : a < b ? -1 : 1 - } - const anum = numeric.test(a) const bnum = numeric.test(b) diff --git a/frontend-admin/node_modules/react-native-worklets/node_modules/semver/package.json b/frontend-admin/node_modules/react-native-worklets/node_modules/semver/package.json index 2b8cadaa..1fbef5a9 100644 --- a/frontend-admin/node_modules/react-native-worklets/node_modules/semver/package.json +++ b/frontend-admin/node_modules/react-native-worklets/node_modules/semver/package.json @@ -1,6 +1,6 @@ { "name": "semver", - "version": "7.7.3", + "version": "7.7.2", "description": "The semantic version parser used by npm.", "main": "index.js", "scripts": { @@ -15,7 +15,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^5.0.0", - "@npmcli/template-oss": "4.25.1", + "@npmcli/template-oss": "4.24.3", "benchmark": "^2.1.4", "tap": "^16.0.0" }, @@ -52,7 +52,7 @@ "author": "GitHub Inc.", "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.25.1", + "version": "4.24.3", "engines": ">=10", "distPaths": [ "classes/", diff --git a/frontend-admin/node_modules/react-native-worklets/package.json b/frontend-admin/node_modules/react-native-worklets/package.json index c0046427..13fa4d53 100644 --- a/frontend-admin/node_modules/react-native-worklets/package.json +++ b/frontend-admin/node_modules/react-native-worklets/package.json @@ -1,6 +1,6 @@ { "name": "react-native-worklets", - "version": "0.7.2", + "version": "0.5.1", "description": "The React Native multithreading library", "keywords": [ "react-native", @@ -31,12 +31,12 @@ "lint:js": "eslint src && yarn prettier --check src", "lint:plugin": "yarn workspace babel-plugin-worklets lint", "test": "jest", - "type:check": "yarn type:check:src:native && yarn type:check:src:web && yarn type:check:plugin && yarn type:check:app && yarn type:check:tests", - "type:check:src:native": "yarn tsc --noEmit", - "type:check:src:web": "yarn tsc --noEmit --project tsconfig.web.json", + "type:check": "yarn type:check:src && yarn type:check:plugin && yarn type:check:app && yarn type:check:tests", + "type:check:src": "yarn tsc --noEmit", "type:check:app": "yarn workspace common-app type:check", "type:check:plugin": "yarn workspace babel-plugin-worklets type:check", - "type:check:tests": "../../scripts/test-ts.sh __typetests__" + "type:check:tests": "../../scripts/test-ts.sh __typetests__", + "use-strict-check": "node ../../scripts/validate-use-strict.js" }, "repository": { "type": "git", @@ -50,41 +50,41 @@ }, "homepage": "https://docs.swmansion.com/react-native-worklets", "peerDependencies": { - "@babel/core": "*", + "@babel/core": "^7.0.0-0", "react": "*", "react-native": "*" }, "dependencies": { - "@babel/plugin-transform-arrow-functions": "7.27.1", - "@babel/plugin-transform-class-properties": "7.27.1", - "@babel/plugin-transform-classes": "7.28.4", - "@babel/plugin-transform-nullish-coalescing-operator": "7.27.1", - "@babel/plugin-transform-optional-chaining": "7.27.1", - "@babel/plugin-transform-shorthand-properties": "7.27.1", - "@babel/plugin-transform-template-literals": "7.27.1", - "@babel/plugin-transform-unicode-regex": "7.27.1", - "@babel/preset-typescript": "7.27.1", - "convert-source-map": "2.0.0", - "semver": "7.7.3" + "@babel/plugin-transform-arrow-functions": "^7.0.0-0", + "@babel/plugin-transform-class-properties": "^7.0.0-0", + "@babel/plugin-transform-classes": "^7.0.0-0", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.0.0-0", + "@babel/plugin-transform-optional-chaining": "^7.0.0-0", + "@babel/plugin-transform-shorthand-properties": "^7.0.0-0", + "@babel/plugin-transform-template-literals": "^7.0.0-0", + "@babel/plugin-transform-unicode-regex": "^7.0.0-0", + "@babel/preset-typescript": "^7.16.7", + "convert-source-map": "^2.0.0", + "semver": "7.7.2" }, "devDependencies": { - "@babel/cli": "7.28.3", - "@babel/core": "7.28.4", + "@babel/cli": "^7.20.0", + "@babel/core": "^7.25.2", "@react-native-community/cli": "20.0.0", - "@react-native/eslint-config": "0.83.1", - "@types/jest": "30.0.0", - "@types/node": "24.7.0", - "@types/react": "19.2.2", - "clang-format-node": "1.3.5", - "code-tag": "1.2.0", - "eslint": "9.37.0", - "jest": "30.2.0", - "knip": "5.61.3", - "madge": "8.0.0", - "prettier": "3.6.2", - "react": "19.2.0", - "react-native": "0.83.1", - "react-native-builder-bob": "0.40.13", + "@react-native/eslint-config": "0.81.0", + "@types/jest": "^29.5.5", + "@types/react": "^19.1.0", + "babel-plugin-worklets": "workspace:*", + "clang-format-node": "^1.3.1", + "eslint": "^9.29.0", + "eslint-plugin-reanimated": "workspace:*", + "jest": "^29.0.0", + "knip": "^5.61.3", + "madge": "^5.0.1", + "prettier": "^3.3.3", + "react": "19.1.0", + "react-native": "patch:react-native@npm%3A0.81.0#~/.yarn/patches/react-native-npm-0.81.0-96e336150b.patch", + "react-native-builder-bob": "patch:react-native-builder-bob@npm%3A0.33.1#~/.yarn/patches/react-native-builder-bob-npm-0.33.1-383d9e23a5.patch", "typescript": "5.8.3" }, "main": "./lib/module/index", @@ -104,7 +104,6 @@ "scripts/worklets_utils.rb", "scripts/validate-react-native-version.js", "plugin/index.js", - "plugin/index.d.ts", "*.podspec", "react-native.config.js", "!apple/build", @@ -118,15 +117,6 @@ "!**/__mocks__", "!**/.*" ], - "sideEffects": [ - "./src/index.ts", - "./lib/module/index.js", - "./**/runtimeKind.{js,ts}", - "./**/serializable.native.{js,ts}", - "./**/workletRuntimeEntry.native.{js,ts}", - "./**/initializers.native.{js,ts}", - "./**/featureFlags.native.{js,ts}" - ], "react-native-builder-bob": { "source": "src", "output": "lib", @@ -134,8 +124,8 @@ [ "module", { - "esm": false, - "jsxRuntime": "automatic" + "esm": true, + "jsxRuntime": "classic" } ], "typescript" diff --git a/frontend-admin/node_modules/react-native-worklets/plugin/index.d.ts b/frontend-admin/node_modules/react-native-worklets/plugin/index.d.ts deleted file mode 100644 index 5aa30926..00000000 --- a/frontend-admin/node_modules/react-native-worklets/plugin/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface PluginOptions { - bundleMode?: boolean; - disableInlineStylesWarning?: boolean; - disableSourceMaps?: boolean; - disableWorkletClasses?: boolean; - extraPlugins?: string[]; - extraPresets?: string[]; - globals?: string[]; - omitNativeOnlyData?: boolean; - relativeSourceLocation?: boolean; - substituteWebPlatformChecks?: boolean; - workletizableModules?: string[]; -} diff --git a/frontend-admin/node_modules/react-native-worklets/plugin/index.js b/frontend-admin/node_modules/react-native-worklets/plugin/index.js index 098edfaf..6419dc44 100644 --- a/frontend-admin/node_modules/react-native-worklets/plugin/index.js +++ b/frontend-admin/node_modules/react-native-worklets/plugin/index.js @@ -30,7 +30,7 @@ var require_gestureHandlerAutoworkletization = __commonJS({ "lib/gestureHandlerAutoworkletization.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.gestureHandlerObjectHooks = exports2.gestureHandlerBuilderMethods = void 0; + exports2.gestureHandlerBuilderMethods = void 0; exports2.isGestureHandlerEventCallback = isGestureHandlerEventCallback; exports2.isGestureObjectEventCallbackMethod = isGestureObjectEventCallbackMethod; var types_12 = require("@babel/types"); @@ -61,17 +61,6 @@ var require_gestureHandlerAutoworkletization = __commonJS({ "onTouchesUp", "onTouchesCancelled" ]); - exports2.gestureHandlerObjectHooks = /* @__PURE__ */ new Set([ - "useTapGesture", - "usePanGesture", - "usePinchGesture", - "useRotationGesture", - "useFlingGesture", - "useLongPressGesture", - "useNativeGesture", - "useManualGesture", - "useHoverGesture" - ]); function isGestureHandlerEventCallback(path) { return (0, types_12.isCallExpression)(path.parent) && (0, types_12.isExpression)(path.parent.callee) && isGestureObjectEventCallbackMethod(path.parent.callee); } @@ -281,97 +270,6 @@ var require_types = __commonJS({ } }); -// lib/referencedWorklets.js -var require_referencedWorklets = __commonJS({ - "lib/referencedWorklets.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findReferencedWorklet = findReferencedWorklet; - var types_12 = require("@babel/types"); - var types_2 = require_types(); - function findReferencedWorklet(workletIdentifier, acceptWorkletizableFunction, acceptObject, state) { - const workletName = workletIdentifier.node.name; - const scope = workletIdentifier.scope; - const workletBinding = scope.getBinding(workletName); - if (!workletBinding) { - return void 0; - } - if (state.opts.bundleMode && bindingIsWorklet(workletBinding)) { - return void 0; - } - if (acceptWorkletizableFunction && workletBinding.path.isFunctionDeclaration()) { - return workletBinding.path; - } - const isConstant = workletBinding.constant; - if (isConstant) { - return findReferencedWorkletFromVariableDeclarator(workletBinding, acceptWorkletizableFunction, acceptObject, state); - } - return findReferencedWorkletFromAssignmentExpression(workletBinding, acceptWorkletizableFunction, acceptObject, state); - } - function findReferencedWorkletFromVariableDeclarator(workletBinding, acceptWorkletizableFunction, acceptObject, state) { - const workletDeclaration = workletBinding.path; - if (!workletDeclaration.isVariableDeclarator()) { - return void 0; - } - const worklet = workletDeclaration.get("init"); - if (acceptWorkletizableFunction && (0, types_2.isWorkletizableFunctionPath)(worklet)) { - return worklet; - } - if (acceptObject && (0, types_2.isWorkletizableObjectPath)(worklet)) { - return worklet; - } - if (worklet.isIdentifier() && worklet.isReferencedIdentifier()) { - return findReferencedWorklet(worklet, acceptWorkletizableFunction, acceptObject, state); - } - return void 0; - } - function findReferencedWorkletFromAssignmentExpression(workletBinding, acceptWorkletizableFunction, acceptObject, state) { - const workletDeclaration = workletBinding.constantViolations.reverse().find((constantViolation) => constantViolation.isAssignmentExpression() && (acceptWorkletizableFunction && (0, types_2.isWorkletizableFunctionPath)(constantViolation.get("right")) || acceptObject && (0, types_2.isWorkletizableObjectPath)(constantViolation.get("right")))); - if (!workletDeclaration || !workletDeclaration.isAssignmentExpression()) { - return void 0; - } - const workletDefinition = workletDeclaration.get("right"); - if (acceptWorkletizableFunction && (0, types_2.isWorkletizableFunctionPath)(workletDefinition)) { - return workletDefinition; - } - if (acceptObject && (0, types_2.isWorkletizableObjectPath)(workletDefinition)) { - return workletDefinition; - } - if (workletDefinition.isIdentifier() && workletDefinition.isReferencedIdentifier()) { - return findReferencedWorklet(workletDefinition, acceptWorkletizableFunction, acceptObject, state); - } - return void 0; - } - function bindingIsWorklet(binding) { - return binding.referencePaths.some((refPath) => !Array.isArray(refPath.container) && (0, types_12.isMemberExpression)(refPath.container) && refPath.container.object === refPath.node && (0, types_12.isIdentifier)(refPath.container.property) && refPath.container.property.name === "__workletHash"); - } - } -}); - -// lib/findWorklet.js -var require_findWorklet = __commonJS({ - "lib/findWorklet.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findWorklet = findWorklet; - var referencedWorklets_1 = require_referencedWorklets(); - var types_12 = require_types(); - function findWorklet(nodePath, state, acceptWorkletizableFunction, acceptObject) { - if (acceptWorkletizableFunction && (0, types_12.isWorkletizableFunctionPath)(nodePath)) { - return nodePath; - } - if (acceptObject && (0, types_12.isWorkletizableObjectPath)(nodePath)) { - return nodePath; - } - if (nodePath.isIdentifier() && nodePath.isReferencedIdentifier()) { - const worklet = (0, referencedWorklets_1.findReferencedWorklet)(nodePath, acceptWorkletizableFunction, acceptObject, state); - return worklet; - } - return void 0; - } - } -}); - // lib/utils.js var require_utils = __commonJS({ "lib/utils.js"(exports2) { @@ -673,8 +571,9 @@ var require_transform = __commonJS({ "use strict"; var __rest = exports2 && exports2.__rest || function(s, e) { var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) @@ -700,8 +599,9 @@ var require_transform = __commonJS({ var require_workletStringCode = __commonJS({ "lib/workletStringCode.js"(exports2) { "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { @@ -709,34 +609,40 @@ var require_workletStringCode = __commonJS({ } }; } Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; + } : function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; o[k2] = m[k]; - })); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + }); + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { + } : function(o, v) { o["default"] = v; }); - var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { + var __importStar = exports2 && exports2.__importStar || function() { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function(o2) { var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; + for (var k in o2) + if (Object.prototype.hasOwnProperty.call(o2, k)) + ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function(mod) { - if (mod && mod.__esModule) return mod; + if (mod && mod.__esModule) + return mod; var result = {}; if (mod != null) { - for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + for (var k = ownKeys(mod), i = 0; i < k.length; i++) + if (k[i] !== "default") + __createBinding(result, mod, k[i]); } __setModuleDefault(result, mod); return result; }; - })(); + }(); var __importDefault = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; @@ -761,28 +667,26 @@ var require_workletStringCode = __commonJS({ (0, assert_1.strict)("params" in expression, "'params' property is undefined in 'expression'"); (0, assert_1.strict)((0, types_12.isBlockStatement)(expression.body), "[Reanimated] `expression.body` is not a `BlockStatement`"); const parsedClasses = /* @__PURE__ */ new Set(); - if (!state.opts.disableWorkletClasses) { - (0, core_1.traverse)(fun, { - NewExpression(path) { - if (!(0, types_12.isIdentifier)(path.node.callee)) { - return; - } - const constructorName = path.node.callee.name; - if (!closureVariables.some((variable) => variable.name === constructorName) || parsedClasses.has(constructorName)) { - return; - } - const index = closureVariables.findIndex((variable) => variable.name === constructorName); - closureVariables.splice(index, 1); - const workletClassFactoryName = constructorName + types_2.workletClassFactorySuffix; - closureVariables.push((0, types_12.identifier)(workletClassFactoryName)); - (0, types_12.assertBlockStatement)(expression.body); - expression.body.body.unshift((0, types_12.variableDeclaration)("const", [ - (0, types_12.variableDeclarator)((0, types_12.identifier)(constructorName), (0, types_12.callExpression)((0, types_12.identifier)(workletClassFactoryName), [])) - ])); - parsedClasses.add(constructorName); + (0, core_1.traverse)(fun, { + NewExpression(path) { + if (!(0, types_12.isIdentifier)(path.node.callee)) { + return; } - }); - } + const constructorName = path.node.callee.name; + if (!closureVariables.some((variable) => variable.name === constructorName) || parsedClasses.has(constructorName)) { + return; + } + const index = closureVariables.findIndex((variable) => variable.name === constructorName); + closureVariables.splice(index, 1); + const workletClassFactoryName = constructorName + types_2.workletClassFactorySuffix; + closureVariables.push((0, types_12.identifier)(workletClassFactoryName)); + (0, types_12.assertBlockStatement)(expression.body); + expression.body.body.unshift((0, types_12.variableDeclaration)("const", [ + (0, types_12.variableDeclarator)((0, types_12.identifier)(constructorName), (0, types_12.callExpression)((0, types_12.identifier)(workletClassFactoryName), [])) + ])); + parsedClasses.add(constructorName); + } + }); const workletFunction = (0, types_12.functionExpression)((0, types_12.identifier)(workletName), expression.params, expression.body, expression.generator, expression.async); const code = (0, generator_1.default)(workletFunction).code; (0, assert_1.strict)(inputMap, "[Reanimated] `inputMap` is undefined."); @@ -1156,23 +1060,9 @@ var require_objectWorklets = __commonJS({ "lib/objectWorklets.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.tryProcessingNode = tryProcessingNode; exports2.processWorkletizableObject = processWorkletizableObject; - var findWorklet_1 = require_findWorklet(); var types_12 = require_types(); var workletSubstitution_12 = require_workletSubstitution(); - function tryProcessingNode(arg, state, acceptWorkletizableFunction, acceptObject) { - var _a; - const maybeWorklet = (0, findWorklet_1.findWorklet)(arg, state, acceptWorkletizableFunction, acceptObject); - if (!maybeWorklet || ((_a = maybeWorklet.getFunctionParent()) === null || _a === void 0 ? void 0 : _a.node.workletized)) { - return; - } - if ((0, types_12.isWorkletizableFunctionPath)(maybeWorklet)) { - (0, workletSubstitution_12.processWorklet)(maybeWorklet, state); - } else if ((0, types_12.isWorkletizableObjectPath)(maybeWorklet)) { - processWorkletizableObject(maybeWorklet, state); - } - } function processWorkletizableObject(path, state) { const properties = path.get("properties"); for (const property of properties) { @@ -1180,7 +1070,9 @@ var require_objectWorklets = __commonJS({ (0, workletSubstitution_12.processWorklet)(property, state); } else if (property.isObjectProperty()) { const value = property.get("value"); - tryProcessingNode(value, state, true, false); + if ((0, types_12.isWorkletizableFunctionPath)(value)) { + (0, workletSubstitution_12.processWorklet)(value, state); + } } else { throw new Error(`[Reanimated] '${property.type}' as to-be workletized argument is not supported for object hooks.`); } @@ -1189,6 +1081,66 @@ var require_objectWorklets = __commonJS({ } }); +// lib/referencedWorklets.js +var require_referencedWorklets = __commonJS({ + "lib/referencedWorklets.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.findReferencedWorklet = findReferencedWorklet; + var types_12 = require_types(); + function findReferencedWorklet(workletIdentifier, acceptWorkletizableFunction, acceptObject) { + const workletName = workletIdentifier.node.name; + const scope = workletIdentifier.scope; + const workletBinding = scope.getBinding(workletName); + if (!workletBinding) { + return void 0; + } + if (acceptWorkletizableFunction && workletBinding.path.isFunctionDeclaration()) { + return workletBinding.path; + } + const isConstant = workletBinding.constant; + if (isConstant) { + return findReferencedWorkletFromVariableDeclarator(workletBinding, acceptWorkletizableFunction, acceptObject); + } + return findReferencedWorkletFromAssignmentExpression(workletBinding, acceptWorkletizableFunction, acceptObject); + } + function findReferencedWorkletFromVariableDeclarator(workletBinding, acceptWorkletizableFunction, acceptObject) { + const workletDeclaration = workletBinding.path; + if (!workletDeclaration.isVariableDeclarator()) { + return void 0; + } + const worklet = workletDeclaration.get("init"); + if (acceptWorkletizableFunction && (0, types_12.isWorkletizableFunctionPath)(worklet)) { + return worklet; + } + if (acceptObject && (0, types_12.isWorkletizableObjectPath)(worklet)) { + return worklet; + } + if (worklet.isIdentifier() && worklet.isReferencedIdentifier()) { + return findReferencedWorklet(worklet, acceptWorkletizableFunction, acceptObject); + } + return void 0; + } + function findReferencedWorkletFromAssignmentExpression(workletBinding, acceptWorkletizableFunction, acceptObject) { + const workletDeclaration = workletBinding.constantViolations.reverse().find((constantViolation) => constantViolation.isAssignmentExpression() && (acceptWorkletizableFunction && (0, types_12.isWorkletizableFunctionPath)(constantViolation.get("right")) || acceptObject && (0, types_12.isWorkletizableObjectPath)(constantViolation.get("right")))); + if (!workletDeclaration || !workletDeclaration.isAssignmentExpression()) { + return void 0; + } + const workletDefinition = workletDeclaration.get("right"); + if (acceptWorkletizableFunction && (0, types_12.isWorkletizableFunctionPath)(workletDefinition)) { + return workletDefinition; + } + if (acceptObject && (0, types_12.isWorkletizableObjectPath)(workletDefinition)) { + return workletDefinition; + } + if (workletDefinition.isIdentifier() && workletDefinition.isReferencedIdentifier()) { + return findReferencedWorklet(workletDefinition, acceptWorkletizableFunction, acceptObject); + } + return void 0; + } + } +}); + // lib/autoworkletization.js var require_autoworkletization = __commonJS({ "lib/autoworkletization.js"(exports2) { @@ -1200,11 +1152,10 @@ var require_autoworkletization = __commonJS({ var gestureHandlerAutoworkletization_1 = require_gestureHandlerAutoworkletization(); var layoutAnimationAutoworkletization_1 = require_layoutAnimationAutoworkletization(); var objectWorklets_1 = require_objectWorklets(); + var referencedWorklets_1 = require_referencedWorklets(); + var types_2 = require_types(); var workletSubstitution_12 = require_workletSubstitution(); - var reanimatedObjectHooks = /* @__PURE__ */ new Set([ - "useAnimatedScrollHandler", - ...Array.from(gestureHandlerAutoworkletization_1.gestureHandlerObjectHooks) - ]); + var reanimatedObjectHooks = /* @__PURE__ */ new Set(["useAnimatedScrollHandler"]); var reanimatedFunctionHooks = /* @__PURE__ */ new Set([ "useFrameCallback", "useAnimatedStyle", @@ -1244,7 +1195,6 @@ var require_autoworkletization = __commonJS({ ["runOnUIAsync", [0]], ["runOnRuntime", [1]], ["scheduleOnRuntime", [1]], - ...Array.from(gestureHandlerAutoworkletization_1.gestureHandlerObjectHooks).map((name) => [name, [0]]), ...Array.from(gestureHandlerAutoworkletization_1.gestureHandlerBuilderMethods).map((name) => [name, [0]]) ]); function processIfAutoworkletizableCallback(path, state) { @@ -1273,39 +1223,29 @@ var require_autoworkletization = __commonJS({ } function processArgs(args, state, acceptWorkletizableFunction, acceptObject) { args.forEach((arg) => { - (0, objectWorklets_1.tryProcessingNode)(arg, state, acceptWorkletizableFunction, acceptObject); + var _a; + const maybeWorklet = findWorklet(arg, acceptWorkletizableFunction, acceptObject); + if (!maybeWorklet || ((_a = maybeWorklet.getFunctionParent()) === null || _a === void 0 ? void 0 : _a.node.workletized)) { + return; + } + if ((0, types_2.isWorkletizableFunctionPath)(maybeWorklet)) { + (0, workletSubstitution_12.processWorklet)(maybeWorklet, state); + } else if ((0, types_2.isWorkletizableObjectPath)(maybeWorklet)) { + (0, objectWorklets_1.processWorkletizableObject)(maybeWorklet, state); + } }); } - } -}); - -// lib/bundleMode.js -var require_bundleMode = __commonJS({ - "lib/bundleMode.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toggleBundleMode = toggleBundleMode; - var types_12 = require("@babel/types"); - function toggleBundleMode(path, state) { - var _a; - if (!state.opts.bundleMode || !((_a = state.filename) === null || _a === void 0 ? void 0 : _a.includes("workletRuntimeEntry"))) { - return; + function findWorklet(arg, acceptWorkletizableFunction, acceptObject) { + if (acceptWorkletizableFunction && (0, types_2.isWorkletizableFunctionPath)(arg)) { + return arg; } - const expressionPath = path.get("expression"); - if (!expressionPath.isAssignmentExpression()) { - return; + if (acceptObject && (0, types_2.isWorkletizableObjectPath)(arg)) { + return arg; } - const left = expressionPath.get("left"); - if (!left.isMemberExpression()) { - return; + if (arg.isIdentifier() && arg.isReferencedIdentifier()) { + return (0, referencedWorklets_1.findReferencedWorklet)(arg, acceptWorkletizableFunction, acceptObject); } - const object = left.get("object"); - const property = left.get("property"); - if (!object.isIdentifier() || object.node.name !== "globalThis" || !property.isIdentifier() || property.node.name !== "_WORKLETS_BUNDLE_MODE") { - return; - } - const right = expressionPath.get("right"); - right.replaceWith((0, types_12.booleanLiteral)(true)); + return void 0; } } }); @@ -1763,7 +1703,6 @@ var require_webOptimization = __commonJS({ // lib/plugin.js Object.defineProperty(exports, "__esModule", { value: true }); var autoworkletization_1 = require_autoworkletization(); -var bundleMode_1 = require_bundleMode(); var class_1 = require_class(); var contextObject_1 = require_contextObject(); var file_1 = require_file(); @@ -1816,9 +1755,6 @@ module.exports = function WorkletsBabelPlugin() { ClassDeclaration: { enter(path, state) { runWithTaggedExceptions(() => { - if (state.opts.disableWorkletClasses) { - return; - } (0, class_1.processIfWorkletClass)(path, state); }); } @@ -1830,13 +1766,6 @@ module.exports = function WorkletsBabelPlugin() { }); } }, - ExpressionStatement: { - enter(path, state) { - runWithTaggedExceptions(() => { - (0, bundleMode_1.toggleBundleMode)(path, state); - }); - } - }, JSXAttribute: { enter(path, state) { runWithTaggedExceptions(() => (0, inlineStylesWarning_1.processInlineStylesWarning)(path, state)); diff --git a/frontend-admin/node_modules/react-native-worklets/scripts/validate-react-native-version.js b/frontend-admin/node_modules/react-native-worklets/scripts/validate-react-native-version.js index c303a78d..6ff17ab5 100644 --- a/frontend-admin/node_modules/react-native-worklets/scripts/validate-react-native-version.js +++ b/frontend-admin/node_modules/react-native-worklets/scripts/validate-react-native-version.js @@ -38,6 +38,6 @@ for (const version of supportedRNVersions) { // eslint-disable-next-line reanimated/use-logger console.error( - `[Worklets] Your installed version of React Native (${reactNativeVersion}) is not compatible with installed version of Worklets (${workletsVersion}). See the documentation for the list of supported versions: https://docs.swmansion.com/react-native-worklets/docs/guides/compatibility/` + `[Worklets] React Native ${reactNativeVersion} version is not compatible with Worklets ${workletsVersion}` ); process.exit(1); diff --git a/frontend-admin/node_modules/react-native-worklets/scripts/worklets_utils.rb b/frontend-admin/node_modules/react-native-worklets/scripts/worklets_utils.rb index 57101382..a42a309e 100644 --- a/frontend-admin/node_modules/react-native-worklets/scripts/worklets_utils.rb +++ b/frontend-admin/node_modules/react-native-worklets/scripts/worklets_utils.rb @@ -57,7 +57,7 @@ end def worklets_assert_minimal_react_native_version(config) validate_react_native_version_script = File.expand_path(File.join(__dir__, 'validate-react-native-version.js')) unless system("node \"#{validate_react_native_version_script}\" #{config[:react_native_version]}") - raise "[Worklets] Your installed version of React Native is not compatible with installed version of Worklets. See the documentation for the list of supported versions: https://docs.swmansion.com/react-native-worklets/docs/guides/compatibility/" + raise "[Worklets] React Native version is not compatible with Worklets" end end diff --git a/frontend-admin/node_modules/react-native-worklets/src/WorkletsModule/NativeWorklets.native.ts b/frontend-admin/node_modules/react-native-worklets/src/WorkletsModule/NativeWorklets.native.ts deleted file mode 100644 index 9a12fada..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/WorkletsModule/NativeWorklets.native.ts +++ /dev/null @@ -1,275 +0,0 @@ -'use strict'; - -import { checkCppVersion } from '../debug/checkCppVersion'; -import { jsVersion } from '../debug/jsVersion'; -import { WorkletsError } from '../debug/WorkletsError'; -import type { SerializableRef, SynchronizableRef } from '../memory/types'; -import { RuntimeKind } from '../runtimeKind'; -import { WorkletsTurboModule } from '../specs'; -import type { WorkletRuntime } from '../types'; -import type { - IWorkletsModule, - WorkletsModuleProxy, -} from './workletsModuleProxy'; - -class NativeWorklets implements IWorkletsModule { - #workletsModuleProxy: WorkletsModuleProxy; - #serializableUndefined: SerializableRef; - #serializableNull: SerializableRef; - #serializableTrue: SerializableRef; - #serializableFalse: SerializableRef; - - constructor() { - globalThis._WORKLETS_VERSION_JS = jsVersion; - if ( - global.__workletsModuleProxy === undefined && - globalThis.__RUNTIME_KIND === RuntimeKind.ReactNative - ) { - WorkletsTurboModule?.installTurboModule(); - } - if (global.__workletsModuleProxy === undefined) { - throw new WorkletsError( - `Native part of Worklets doesn't seem to be initialized. -See https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#native-part-of-worklets-doesnt-seem-to-be-initialized for more details.` - ); - } - if (__DEV__ && globalThis.__RUNTIME_KIND === RuntimeKind.ReactNative) { - checkCppVersion(); - } - this.#workletsModuleProxy = global.__workletsModuleProxy; - this.#serializableNull = this.#workletsModuleProxy.createSerializableNull(); - this.#serializableUndefined = - this.#workletsModuleProxy.createSerializableUndefined(); - this.#serializableTrue = - this.#workletsModuleProxy.createSerializableBoolean(true); - this.#serializableFalse = - this.#workletsModuleProxy.createSerializableBoolean(false); - } - - createSerializable( - value: TValue, - shouldPersistRemote: boolean, - nativeStateSource?: object - ) { - return this.#workletsModuleProxy.createSerializable( - value, - shouldPersistRemote, - nativeStateSource - ); - } - - createSerializableImport( - from: string, - to: string - ): SerializableRef { - return this.#workletsModuleProxy.createSerializableImport(from, to); - } - - createSerializableString(str: string) { - return this.#workletsModuleProxy.createSerializableString(str); - } - - createSerializableNumber(num: number) { - return this.#workletsModuleProxy.createSerializableNumber(num); - } - - createSerializableBoolean(bool: boolean) { - return bool ? this.#serializableTrue : this.#serializableFalse; - } - - createSerializableBigInt(bigInt: bigint) { - return this.#workletsModuleProxy.createSerializableBigInt(bigInt); - } - - createSerializableUndefined() { - return this.#serializableUndefined; - } - - createSerializableNull() { - return this.#serializableNull; - } - - createSerializableTurboModuleLike< - TProps extends object, - TProto extends object, - >(props: TProps, proto: TProto): SerializableRef { - return this.#workletsModuleProxy.createSerializableTurboModuleLike( - props, - proto - ); - } - - createSerializableObject( - obj: T, - shouldRetainRemote: boolean, - nativeStateSource?: object - ): SerializableRef { - return this.#workletsModuleProxy.createSerializableObject( - obj, - shouldRetainRemote, - nativeStateSource - ); - } - - createSerializableHostObject(obj: T) { - return this.#workletsModuleProxy.createSerializableHostObject(obj); - } - - createSerializableArray(array: unknown[], shouldRetainRemote: boolean) { - return this.#workletsModuleProxy.createSerializableArray( - array, - shouldRetainRemote - ); - } - - createSerializableMap( - keys: TKey[], - values: TValue[] - ): SerializableRef> { - return this.#workletsModuleProxy.createSerializableMap(keys, values); - } - - createSerializableSet( - values: TValues[] - ): SerializableRef> { - return this.#workletsModuleProxy.createSerializableSet(values); - } - - createSerializableInitializer(obj: object) { - return this.#workletsModuleProxy.createSerializableInitializer(obj); - } - - createSerializableFunction( - func: (...args: TArgs) => TReturn - ) { - return this.#workletsModuleProxy.createSerializableFunction(func); - } - - createSerializableWorklet(worklet: object, shouldPersistRemote: boolean) { - return this.#workletsModuleProxy.createSerializableWorklet( - worklet, - shouldPersistRemote - ); - } - - createCustomSerializable( - data: SerializableRef, - typeId: number - ): SerializableRef { - return this.#workletsModuleProxy.createCustomSerializable(data, typeId); - } - - registerCustomSerializable( - determine: SerializableRef, - pack: SerializableRef, - unpack: SerializableRef, - typeId: number - ): void { - this.#workletsModuleProxy.registerCustomSerializable( - determine, - pack, - unpack, - typeId - ); - } - - scheduleOnUI(serializable: SerializableRef) { - return this.#workletsModuleProxy.scheduleOnUI(serializable); - } - - executeOnUIRuntimeSync( - serializable: SerializableRef - ): TReturn { - return this.#workletsModuleProxy.executeOnUIRuntimeSync(serializable); - } - - createWorkletRuntime( - name: string, - initializer: SerializableRef<() => void>, - useDefaultQueue: boolean, - customQueue: object | undefined, - enableEventLoop: boolean - ) { - return this.#workletsModuleProxy.createWorkletRuntime( - name, - initializer, - useDefaultQueue, - customQueue, - enableEventLoop - ); - } - - scheduleOnRuntime( - workletRuntime: WorkletRuntime, - serializableWorklet: SerializableRef - ) { - return this.#workletsModuleProxy.scheduleOnRuntime( - workletRuntime, - serializableWorklet - ); - } - - createSynchronizable(value: TValue): SynchronizableRef { - return this.#workletsModuleProxy.createSynchronizable(value); - } - - synchronizableGetDirty( - synchronizableRef: SynchronizableRef - ): TValue { - return this.#workletsModuleProxy.synchronizableGetDirty(synchronizableRef); - } - - synchronizableGetBlocking( - synchronizableRef: SynchronizableRef - ): TValue { - return this.#workletsModuleProxy.synchronizableGetBlocking( - synchronizableRef - ); - } - - synchronizableSetBlocking( - synchronizableRef: SynchronizableRef, - value: SerializableRef - ) { - return this.#workletsModuleProxy.synchronizableSetBlocking( - synchronizableRef, - value - ); - } - - synchronizableLock( - synchronizableRef: SynchronizableRef - ): void { - return this.#workletsModuleProxy.synchronizableLock(synchronizableRef); - } - - synchronizableUnlock( - synchronizableRef: SynchronizableRef - ): void { - return this.#workletsModuleProxy.synchronizableUnlock(synchronizableRef); - } - - reportFatalErrorOnJS( - message: string, - stack: string, - name: string, - jsEngine: string - ) { - return this.#workletsModuleProxy.reportFatalErrorOnJS( - message, - stack, - name, - jsEngine - ); - } - - getStaticFeatureFlag(name: string): boolean { - return this.#workletsModuleProxy.getStaticFeatureFlag(name); - } - - setDynamicFeatureFlag(name: string, value: boolean) { - this.#workletsModuleProxy.setDynamicFeatureFlag(name, value); - } -} - -export const WorkletsModule: IWorkletsModule = new NativeWorklets(); diff --git a/frontend-admin/node_modules/react-native-worklets/src/WorkletsModule/NativeWorklets.ts b/frontend-admin/node_modules/react-native-worklets/src/WorkletsModule/NativeWorklets.ts index 9d7a1d6d..456dc34d 100644 --- a/frontend-admin/node_modules/react-native-worklets/src/WorkletsModule/NativeWorklets.ts +++ b/frontend-admin/node_modules/react-native-worklets/src/WorkletsModule/NativeWorklets.ts @@ -1,10 +1,256 @@ 'use strict'; -import type { IWorkletsModule } from './workletsModuleProxy'; - -export type { +import { RuntimeKind } from '../runtimeKind'; +import { WorkletsTurboModule } from '../specs'; +import type { SynchronizableRef } from '../synchronizable'; +import { checkCppVersion } from '../utils/checkCppVersion'; +import { jsVersion } from '../utils/jsVersion'; +import { WorkletsError } from '../WorkletsError'; +import type { SerializableRef, WorkletRuntime } from '../workletTypes'; +import type { IWorkletsModule, WorkletsModuleProxy, } from './workletsModuleProxy'; -export const WorkletsModule: IWorkletsModule = null!; +export function createNativeWorkletsModule(): IWorkletsModule { + return new NativeWorklets(); +} + +class NativeWorklets implements IWorkletsModule { + #workletsModuleProxy: WorkletsModuleProxy; + #serializableUndefined: SerializableRef; + #serializableNull: SerializableRef; + #serializableTrue: SerializableRef; + #serializableFalse: SerializableRef; + + constructor() { + globalThis._WORKLETS_VERSION_JS = jsVersion; + if ( + global.__workletsModuleProxy === undefined && + globalThis.__RUNTIME_KIND === RuntimeKind.ReactNative + ) { + WorkletsTurboModule?.installTurboModule(); + } + if (global.__workletsModuleProxy === undefined) { + throw new WorkletsError( + `Native part of Worklets doesn't seem to be initialized. +See https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#native-part-of-worklets-doesnt-seem-to-be-initialized for more details.` + ); + } + if (__DEV__) { + checkCppVersion(); + } + this.#workletsModuleProxy = global.__workletsModuleProxy; + this.#serializableNull = this.#workletsModuleProxy.createSerializableNull(); + this.#serializableUndefined = + this.#workletsModuleProxy.createSerializableUndefined(); + this.#serializableTrue = + this.#workletsModuleProxy.createSerializableBoolean(true); + this.#serializableFalse = + this.#workletsModuleProxy.createSerializableBoolean(false); + } + + createSerializable( + value: TValue, + shouldPersistRemote: boolean, + nativeStateSource?: object + ) { + return this.#workletsModuleProxy.createSerializable( + value, + shouldPersistRemote, + nativeStateSource + ); + } + + createSerializableImport( + from: string, + to: string + ): SerializableRef { + return this.#workletsModuleProxy.createSerializableImport(from, to); + } + + createSerializableString(str: string) { + return this.#workletsModuleProxy.createSerializableString(str); + } + + createSerializableNumber(num: number) { + return this.#workletsModuleProxy.createSerializableNumber(num); + } + + createSerializableBoolean(bool: boolean) { + return bool ? this.#serializableTrue : this.#serializableFalse; + } + + createSerializableBigInt(bigInt: bigint) { + return this.#workletsModuleProxy.createSerializableBigInt(bigInt); + } + + createSerializableUndefined() { + return this.#serializableUndefined; + } + + createSerializableNull() { + return this.#serializableNull; + } + + createSerializableTurboModuleLike< + TProps extends object, + TProto extends object, + >(props: TProps, proto: TProto): SerializableRef { + return this.#workletsModuleProxy.createSerializableTurboModuleLike( + props, + proto + ); + } + + createSerializableObject( + obj: T, + shouldRetainRemote: boolean, + nativeStateSource?: object + ): SerializableRef { + return this.#workletsModuleProxy.createSerializableObject( + obj, + shouldRetainRemote, + nativeStateSource + ); + } + + createSerializableHostObject(obj: T) { + return this.#workletsModuleProxy.createSerializableHostObject(obj); + } + + createSerializableArray(array: unknown[], shouldRetainRemote: boolean) { + return this.#workletsModuleProxy.createSerializableArray( + array, + shouldRetainRemote + ); + } + + createSerializableMap( + keys: TKey[], + values: TValue[] + ): SerializableRef> { + return this.#workletsModuleProxy.createSerializableMap(keys, values); + } + + createSerializableSet( + values: TValues[] + ): SerializableRef> { + return this.#workletsModuleProxy.createSerializableSet(values); + } + + createSerializableInitializer(obj: object) { + return this.#workletsModuleProxy.createSerializableInitializer(obj); + } + + createSerializableFunction( + func: (...args: TArgs) => TReturn + ) { + return this.#workletsModuleProxy.createSerializableFunction(func); + } + + createSerializableWorklet(worklet: object, shouldPersistRemote: boolean) { + return this.#workletsModuleProxy.createSerializableWorklet( + worklet, + shouldPersistRemote + ); + } + + scheduleOnUI(serializable: SerializableRef) { + return this.#workletsModuleProxy.scheduleOnUI(serializable); + } + + executeOnUIRuntimeSync( + serializable: SerializableRef + ): TReturn { + return this.#workletsModuleProxy.executeOnUIRuntimeSync(serializable); + } + + createWorkletRuntime( + name: string, + initializer: SerializableRef<() => void>, + useDefaultQueue: boolean, + customQueue: object | undefined, + enableEventLoop: boolean + ) { + return this.#workletsModuleProxy.createWorkletRuntime( + name, + initializer, + useDefaultQueue, + customQueue, + enableEventLoop + ); + } + + scheduleOnRuntime( + workletRuntime: WorkletRuntime, + serializableWorklet: SerializableRef + ) { + return this.#workletsModuleProxy.scheduleOnRuntime( + workletRuntime, + serializableWorklet + ); + } + + createSynchronizable(value: TValue): SynchronizableRef { + return this.#workletsModuleProxy.createSynchronizable(value); + } + + synchronizableGetDirty( + synchronizableRef: SynchronizableRef + ): TValue { + return this.#workletsModuleProxy.synchronizableGetDirty(synchronizableRef); + } + + synchronizableGetBlocking( + synchronizableRef: SynchronizableRef + ): TValue { + return this.#workletsModuleProxy.synchronizableGetBlocking( + synchronizableRef + ); + } + + synchronizableSetBlocking( + synchronizableRef: SynchronizableRef, + value: SerializableRef + ) { + return this.#workletsModuleProxy.synchronizableSetBlocking( + synchronizableRef, + value + ); + } + + synchronizableLock( + synchronizableRef: SynchronizableRef + ): void { + return this.#workletsModuleProxy.synchronizableLock(synchronizableRef); + } + + synchronizableUnlock( + synchronizableRef: SynchronizableRef + ): void { + return this.#workletsModuleProxy.synchronizableUnlock(synchronizableRef); + } + + reportFatalErrorOnJS( + message: string, + stack: string, + name: string, + jsEngine: string + ) { + return this.#workletsModuleProxy.reportFatalErrorOnJS( + message, + stack, + name, + jsEngine + ); + } + + getStaticFeatureFlag(name: string): boolean { + return this.#workletsModuleProxy.getStaticFeatureFlag(name); + } + + setDynamicFeatureFlag(name: string, value: boolean) { + this.#workletsModuleProxy.setDynamicFeatureFlag(name, value); + } +} diff --git a/frontend-admin/node_modules/react-native-worklets/src/WorkletsModule/workletsModuleProxy.ts b/frontend-admin/node_modules/react-native-worklets/src/WorkletsModule/workletsModuleProxy.ts index b7d9fb2f..22dd530c 100644 --- a/frontend-admin/node_modules/react-native-worklets/src/WorkletsModule/workletsModuleProxy.ts +++ b/frontend-admin/node_modules/react-native-worklets/src/WorkletsModule/workletsModuleProxy.ts @@ -1,7 +1,7 @@ 'use strict'; -import type { SerializableRef, SynchronizableRef } from '../memory/types'; -import type { WorkletRuntime } from '../types'; +import type { SynchronizableRef } from '../synchronizable'; +import type { SerializableRef, WorkletRuntime } from '../workletTypes'; /** Type of `__workletsModuleProxy` injected with JSI. */ export interface WorkletsModuleProxy { @@ -69,18 +69,6 @@ export interface WorkletsModuleProxy { shouldPersistRemote: boolean ): SerializableRef; - createCustomSerializable( - data: SerializableRef, - typeId: number - ): SerializableRef; - - registerCustomSerializable( - determine: SerializableRef, - pack: SerializableRef, - unpack: SerializableRef, - typeId: number - ): void; - scheduleOnUI(serializable: SerializableRef): void; executeOnUIRuntimeSync( diff --git a/frontend-admin/node_modules/react-native-worklets/src/callGuard.native.ts b/frontend-admin/node_modules/react-native-worklets/src/callGuard.native.ts deleted file mode 100644 index 04439c4c..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/callGuard.native.ts +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -import type { RNError } from './debug/errors'; - -/** Used only with debug builds. */ -export function callGuardDEV( - fn: (...args: Args) => ReturnValue, - ...args: Args -): ReturnValue | void { - 'worklet'; - try { - return fn(...args); - } catch (error) { - if (globalThis.__workletsModuleProxy) { - const { message, stack, name, jsEngine } = error as RNError; - globalThis.__workletsModuleProxy.reportFatalErrorOnJS( - message, - stack ?? '', - name ?? 'WorkletsError', - jsEngine ?? 'Worklets' - ); - } else { - throw error; - } - } -} - -export function setupCallGuard() { - 'worklet'; - if (!globalThis.__callGuardDEV) { - globalThis.__callGuardDEV = callGuardDEV; - } -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/debug/WorkletsError.native.ts b/frontend-admin/node_modules/react-native-worklets/src/debug/WorkletsError.native.ts deleted file mode 100644 index 7a8303b7..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/debug/WorkletsError.native.ts +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -import { RuntimeKind } from '../runtimeKind'; -import type { - IWorkletsErrorConstructor, - WorkletsError as IWorkletsError, -} from './types'; - -function WorkletsErrorConstructor(message?: string): IWorkletsError { - 'worklet'; - const prefix = '[Worklets]'; - - // eslint-disable-next-line reanimated/use-worklets-error - const errorInstance = new Error(message ? `${prefix} ${message}` : prefix); - errorInstance.name = `WorkletsError`; - return errorInstance as IWorkletsError; -} - -/** - * Registers WorkletsError in the global scope. Register only for Worklet - * runtimes. - */ -export function registerWorkletsError() { - 'worklet'; - if ((globalThis.__RUNTIME_KIND as RuntimeKind) !== RuntimeKind.ReactNative) { - (globalThis as Record).WorkletsError = - WorkletsErrorConstructor; - } -} - -export const WorkletsError = - WorkletsErrorConstructor as IWorkletsErrorConstructor; diff --git a/frontend-admin/node_modules/react-native-worklets/src/debug/WorkletsError.ts b/frontend-admin/node_modules/react-native-worklets/src/debug/WorkletsError.ts deleted file mode 100644 index 9d2c5ffb..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/debug/WorkletsError.ts +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -import type { - IWorkletsErrorConstructor, - WorkletsError as IWorkletsError, -} from './types'; - -function WorkletsErrorConstructor(message?: string): IWorkletsError { - const prefix = '[Worklets]'; - - // eslint-disable-next-line reanimated/use-worklets-error - const errorInstance = new Error(message ? `${prefix} ${message}` : prefix); - errorInstance.name = `WorkletsError`; - return errorInstance as IWorkletsError; -} - -export const WorkletsError = - WorkletsErrorConstructor as IWorkletsErrorConstructor; diff --git a/frontend-admin/node_modules/react-native-worklets/src/debug/checkCppVersion.ts b/frontend-admin/node_modules/react-native-worklets/src/debug/checkCppVersion.ts deleted file mode 100644 index a7f8f0eb..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/debug/checkCppVersion.ts +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -import { jsVersion } from './jsVersion'; -import { logger } from './logger'; -import { WorkletsError } from './WorkletsError'; - -export function checkCppVersion() { - const cppVersion = global._WORKLETS_VERSION_CPP; - if (cppVersion === undefined) { - logger.warn( - `Couldn't determine the version of the native part of Worklets. - See \`https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#couldnt-determine-the-version-of-the-native-part-of-worklets\` for more details.` - ); - return; - } - const ok = matchVersion(jsVersion, cppVersion); - if (!ok) { - throw new WorkletsError( - `Mismatch between JavaScript part and native part of Worklets (${jsVersion} vs ${cppVersion}). - See \`https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#mismatch-between-javascript-part-and-native-part-of-worklets\` for more details.` - ); - } -} - -export function matchVersion(version1: string, version2: string) { - if (version1.match(/^\d+\.\d+\.\d+$/) && version2.match(/^\d+\.\d+\.\d+$/)) { - // x.y.z, compare only major and minor, skip patch - const [major1, minor1] = version1.split('.'); - const [major2, minor2] = version2.split('.'); - return major1 === major2 && minor1 === minor2; - } else { - // alpha, beta or rc, compare everything - return version1 === version2; - } -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/debug/errors.native.ts b/frontend-admin/node_modules/react-native-worklets/src/debug/errors.native.ts deleted file mode 100644 index 93fc0a99..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/debug/errors.native.ts +++ /dev/null @@ -1,80 +0,0 @@ -'use strict'; - -import type { WorkletStackDetails } from '../types'; -import { WorkletsError } from './WorkletsError'; - -const _workletStackDetails = new Map(); - -export function registerWorkletStackDetails( - hash: number, - stackDetails: WorkletStackDetails -) { - _workletStackDetails.set(hash, stackDetails); -} - -function getBundleOffset(error: Error): [string, number, number] { - const frame = error.stack?.split('\n')?.[0]; - if (frame) { - const parsedFrame = /@([^@]+):(\d+):(\d+)/.exec(frame); - if (parsedFrame) { - const [, file, line, col] = parsedFrame; - return [file, Number(line), Number(col)]; - } - } - return ['unknown', 0, 0]; -} - -function processStack(stack?: string): string | undefined { - if (stack === '' || stack === undefined) { - return undefined; - } - const workletStackEntries = stack.match(/worklet_(\d+):(\d+):(\d+)/g); - let result = stack; - workletStackEntries?.forEach((match) => { - const [, hash, origLine, origCol] = match.split(/:|_/).map(Number); - const errorDetails = _workletStackDetails.get(hash); - if (!errorDetails) { - return; - } - const [error, lineOffset, colOffset] = errorDetails; - const [bundleFile, bundleLine, bundleCol] = getBundleOffset(error); - const line = origLine + bundleLine + lineOffset; - const col = origCol + bundleCol + colOffset; - - result = result.replace(match, `${bundleFile}:${line}:${col}`); - }); - return result; -} - -export interface RNError extends Error { - jsEngine: string; -} - -/** - * Remote error is an error coming from a Worklet Runtime that we bubble up to - * the RN Runtime. - */ -export function reportFatalRemoteError( - { message, stack, name, jsEngine }: RNError, - force: boolean -): void { - const error = new WorkletsError() as RNError; - error.message = message; - error.stack = processStack(stack); - error.name = name; - error.jsEngine = jsEngine; - if (force) { - throw error; - } else { - // @ts-expect-error React Native's `ErrorUtils` are hidden from the global scope. - globalThis.ErrorUtils.reportFatalError(error); - } -} - -/** - * Registers `reportFatalRemoteError` function in global scope to allow to - * invoke it from C++. - */ -export function registerReportFatalRemoteError() { - globalThis.__reportFatalRemoteError = reportFatalRemoteError; -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/debug/jsVersion.ts b/frontend-admin/node_modules/react-native-worklets/src/debug/jsVersion.ts deleted file mode 100644 index bdb7f9ba..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/debug/jsVersion.ts +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -/** - * We hardcode the version of Worklets here in order to compare it with the - * version used to build the native part of the library in runtime. Remember to - * keep this in sync with the version declared in `package.json` - */ -export const jsVersion = '0.7.2'; diff --git a/frontend-admin/node_modules/react-native-worklets/src/debug/logger.ts b/frontend-admin/node_modules/react-native-worklets/src/debug/logger.ts deleted file mode 100644 index 5d0a14a5..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/debug/logger.ts +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -const PREFIX = '[Worklets]'; - -function formatMessage(message: string) { - return `${PREFIX} ${message}`; -} - -export const logger = { - warn(message: string) { - console.warn(formatMessage(message)); - }, - error(message: string) { - console.error(formatMessage(message)); - }, -}; diff --git a/frontend-admin/node_modules/react-native-worklets/src/debug/types.ts b/frontend-admin/node_modules/react-native-worklets/src/debug/types.ts deleted file mode 100644 index 03286ec9..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/debug/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -export type WorkletsError = Error & { name: 'Worklets' }; // signed type - -export interface IWorkletsErrorConstructor extends Error { - new (message?: string): WorkletsError; - (message?: string): WorkletsError; - readonly prototype: WorkletsError; -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/deprecated.ts b/frontend-admin/node_modules/react-native-worklets/src/deprecated.ts index 3024a1e4..facaea9c 100644 --- a/frontend-admin/node_modules/react-native-worklets/src/deprecated.ts +++ b/frontend-admin/node_modules/react-native-worklets/src/deprecated.ts @@ -5,9 +5,9 @@ import { isSerializableRef, makeShareable, makeShareableCloneOnUIRecursive, -} from './memory/serializable'; -import { serializableMappingCache } from './memory/serializableMappingCache'; -import type { SerializableRef } from './memory/types'; +} from './serializable'; +import { serializableMappingCache } from './serializableMappingCache'; +import type { SerializableRef } from './workletTypes'; /** @deprecated Use {@link SerializableRef} instead. */ export type ShareableRef = SerializableRef; diff --git a/frontend-admin/node_modules/react-native-worklets/src/featureFlags/featureFlags.native.ts b/frontend-admin/node_modules/react-native-worklets/src/featureFlags/featureFlags.native.ts deleted file mode 100644 index c9afa8ca..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/featureFlags/featureFlags.native.ts +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; -import { logger } from '../debug/logger'; -import { WorkletsModule } from '../WorkletsModule/NativeWorklets'; -import type { - DynamicFlagName, - DynamicFlagsType, - StaticFeatureFlagsSchema, -} from './types'; - -export const DynamicFlags: DynamicFlagsType = { - EXAMPLE_DYNAMIC_FLAG: true, - - init() { - Object.keys(DynamicFlags).forEach((key) => { - if (key !== 'init' && key !== 'setFlag' && key !== 'getFlag') { - WorkletsModule.setDynamicFeatureFlag( - key, - DynamicFlags[key as DynamicFlagName] - ); - } - }); - }, - setFlag(name, value) { - if (name in DynamicFlags) { - DynamicFlags[name] = value; - WorkletsModule.setDynamicFeatureFlag(name, value); - } else { - logger.warn( - `The feature flag: '${name}' no longer exists, you can safely remove invocation of \`setDynamicFeatureFlag('${name}')\` from your code.` - ); - } - }, - getFlag(name) { - if (name in DynamicFlags) { - return DynamicFlags[name]; - } else { - logger.warn( - `The feature flag: '${name}' no longer exists, you can safely remove invocation of \`getDynamicFeatureFlag('${name}')\` from your code.` - ); - return false; - } - }, -}; -DynamicFlags.init(); - -// Public API function to update a feature flag -export function setDynamicFeatureFlag( - name: DynamicFlagName, - value: boolean -): void { - DynamicFlags.setFlag(name, value); -} - -// Public API function to read a feature flag -export function getDynamicFeatureFlag(name: DynamicFlagName): boolean { - return DynamicFlags.getFlag(name); -} - -const staticFeatureFlags: Partial = {}; - -export function getStaticFeatureFlag( - name: keyof StaticFeatureFlagsSchema -): boolean { - if (name in staticFeatureFlags) { - return staticFeatureFlags[name]!; - } - const featureFlagValue = WorkletsModule.getStaticFeatureFlag(name); - staticFeatureFlags[name] = featureFlagValue; - return featureFlagValue; -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/featureFlags/featureFlags.ts b/frontend-admin/node_modules/react-native-worklets/src/featureFlags/featureFlags.ts deleted file mode 100644 index c14b8a7e..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/featureFlags/featureFlags.ts +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -import type { DynamicFlagName, StaticFeatureFlagsSchema } from './types'; - -export function getStaticFeatureFlag( - _name: keyof StaticFeatureFlagsSchema -): boolean { - return false; -} - -export function setDynamicFeatureFlag( - _name: DynamicFlagName, - _value: boolean -): void { - // no-op -} - -export function getDynamicFeatureFlag(_name: DynamicFlagName): boolean { - return false; -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/featureFlags/types.ts b/frontend-admin/node_modules/react-native-worklets/src/featureFlags/types.ts deleted file mode 100644 index 1b66b80b..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/featureFlags/types.ts +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -import type StaticFeatureFlagsJSON from './staticFlags.json'; - -export type DynamicFlagsType = { - EXAMPLE_DYNAMIC_FLAG: boolean; - init(): void; - setFlag(name: DynamicFlagName, value: boolean): void; - getFlag(name: DynamicFlagName): boolean; -}; - -export type DynamicFlagName = keyof Omit< - Omit, - 'init' ->; - -/** - * This constant is needed for typechecking and preserving static typechecks in - * generated .d.ts files. Without it, the static flags resolve to an object - * without specific keys. - */ -export const DefaultStaticFeatureFlags = { - RUNTIME_TEST_FLAG: false, - IOS_DYNAMIC_FRAMERATE_ENABLED: false, -} as const satisfies typeof StaticFeatureFlagsJSON; - -export type StaticFeatureFlagsSchema = { - -readonly [K in keyof typeof DefaultStaticFeatureFlags]: boolean; -}; diff --git a/frontend-admin/node_modules/react-native-worklets/src/index.ts b/frontend-admin/node_modules/react-native-worklets/src/index.ts index 7ce17d8b..795e96cb 100644 --- a/frontend-admin/node_modules/react-native-worklets/src/index.ts +++ b/frontend-admin/node_modules/react-native-worklets/src/index.ts @@ -1,51 +1,28 @@ 'use strict'; -import { init } from './initializers/initializers'; -import { bundleModeInit } from './initializers/workletRuntimeEntry'; +import './publicGlobals'; + +import { init } from './initializers'; +import { bundleModeInit } from './workletRuntimeEntry'; init(); -// @ts-expect-error We must trick the bundler to include -// the `workletRuntimeEntry` file the way it cannot optimize it out. -if (globalThis._ALWAYS_FALSE) { - // Bundle mode. - bundleModeInit(); -} - +export type { MakeShareableClone, ShareableRef } from './deprecated'; export { isShareableRef, makeShareable, - type MakeShareableClone, makeShareableCloneOnUIRecursive, makeShareableCloneRecursive, shareableMappingCache, - type ShareableRef, } from './deprecated'; -export { - getDynamicFeatureFlag, - getStaticFeatureFlag, - setDynamicFeatureFlag, -} from './featureFlags/featureFlags'; -export { isSynchronizable } from './memory/isSynchronizable'; -export { - createSerializable, - isSerializableRef, - registerCustomSerializable, -} from './memory/serializable'; -export { serializableMappingCache } from './memory/serializableMappingCache'; -export { createSynchronizable } from './memory/synchronizable'; -export type { - RegistrationData, - SerializableRef, - Synchronizable, - SynchronizableRef, -} from './memory/types'; +export { getStaticFeatureFlag, setDynamicFeatureFlag } from './featureFlags'; +export { isSynchronizable } from './isSynchronizable'; export { getRuntimeKind, RuntimeKind } from './runtimeKind'; -export { - createWorkletRuntime, - runOnRuntime, - scheduleOnRuntime, -} from './runtimes'; +export { createWorkletRuntime, runOnRuntime } from './runtimes'; +export { createSerializable, isSerializableRef } from './serializable'; +export { serializableMappingCache } from './serializableMappingCache'; +export type { Synchronizable } from './synchronizable'; +export { createSynchronizable } from './synchronizable'; export { callMicrotasks, executeOnUIRuntimeSync, @@ -58,14 +35,19 @@ export { // eslint-disable-next-line camelcase unstable_eventLoopTask, } from './threads'; +export { isWorkletFunction } from './workletFunction'; +export type { IWorkletsModule, WorkletsModuleProxy } from './WorkletsModule'; +export { WorkletsModule } from './WorkletsModule'; export type { + SerializableRef, WorkletFunction, WorkletRuntime, WorkletStackDetails, -} from './types'; -export { isWorkletFunction } from './workletFunction'; -export { WorkletsModule } from './WorkletsModule/NativeWorklets'; -export type { - IWorkletsModule, - WorkletsModuleProxy, -} from './WorkletsModule/workletsModuleProxy'; +} from './workletTypes'; + +// @ts-expect-error We must trick the bundler to include +// the `workletRuntimeEntry` file the way it cannot optimize it out. +if (globalThis._ALWAYS_FALSE) { + // Bundle mode. + bundleModeInit(); +} diff --git a/frontend-admin/node_modules/react-native-worklets/src/initializers/initializers.native.ts b/frontend-admin/node_modules/react-native-worklets/src/initializers/initializers.native.ts deleted file mode 100644 index 41b58868..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/initializers/initializers.native.ts +++ /dev/null @@ -1,238 +0,0 @@ -'use strict'; - -import { setupCallGuard } from '../callGuard'; -import { registerReportFatalRemoteError } from '../debug/errors'; -import { registerWorkletsError, WorkletsError } from '../debug/WorkletsError'; -import { bundleValueUnpacker } from '../memory/bundleUnpacker'; -import { __installUnpacker as installCustomSerializableUnpacker } from '../memory/customSerializableUnpacker'; -import { __installUnpacker as installSynchronizableUnpacker } from '../memory/synchronizableUnpacker'; -import { setupSetImmediate } from '../runLoop/common/setImmediatePolyfill'; -import { setupSetInterval } from '../runLoop/common/setIntervalPolyfill'; -import { setupRequestAnimationFrame } from '../runLoop/uiRuntime/requestAnimationFrame'; -import { setupSetTimeout } from '../runLoop/uiRuntime/setTimeoutPolyfill'; -import { RuntimeKind } from '../runtimeKind'; -import { runOnUISync, scheduleOnRN, setupMicrotasks } from '../threads'; -import type { ValueUnpacker } from '../types'; -import { isWorkletFunction } from '../workletFunction'; -import { WorkletsModule } from '../WorkletsModule/NativeWorklets'; - -if (globalThis.__RUNTIME_KIND === undefined) { - // The only runtime that doesn't have `__RUNTIME_KIND` preconfigured - // is the RN Runtime. We must set it as soon as possible. - globalThis.__RUNTIME_KIND = RuntimeKind.ReactNative; -} - -let capturableConsole: typeof console; - -/** - * Currently there seems to be a bug in the JSI layer which causes a crash when - * we try to copy some of the console methods, i.e. `clear` or `dirxml`. - * - * The crash happens only in React Native 0.75. It's not reproducible in neither - * 0.76 nor 0.74. It also happens only in the configuration of a debug app and - * production bundle. - * - * I haven't yet discovered what exactly causes the crash. It's tied to the - * console methods sometimes being `HostFunction`s. Therefore, as a workaround - * we don't copy the methods as they are in the original console object, we copy - * JavaScript wrappers instead. - */ -export function getMemorySafeCapturableConsole(): typeof console { - if (capturableConsole) { - return capturableConsole; - } - - const consoleCopy = Object.fromEntries( - Object.entries(console).map(([methodName, method]) => { - const methodWrapper = function methodWrapper(...args: unknown[]) { - return method(...args); - }; - if (method.name) { - /** - * Set the original method name as the wrapper name if available. - * - * It might be unnecessary but if we want to fully mimic the console - * object we should take into the account the fact some code might rely - * on the method name. - */ - Object.defineProperty(methodWrapper, 'name', { - value: method.name, - writable: false, - }); - } - return [methodName, methodWrapper]; - }) - ); - - capturableConsole = consoleCopy as unknown as typeof console; - - return consoleCopy as unknown as typeof console; -} - -export function setupConsole(boundCapturableConsole: typeof console) { - 'worklet'; - // @ts-ignore TypeScript doesn't like that there are missing methods in console object, but we don't provide all the methods for the UI runtime console version - globalThis.console = { - assert: (...args) => scheduleOnRN(boundCapturableConsole.assert, ...args), - debug: (...args) => scheduleOnRN(boundCapturableConsole.debug, ...args), - log: (...args) => scheduleOnRN(boundCapturableConsole.log, ...args), - warn: (...args) => scheduleOnRN(boundCapturableConsole.warn, ...args), - error: (...args) => scheduleOnRN(boundCapturableConsole.error, ...args), - info: (...args) => scheduleOnRN(boundCapturableConsole.info, ...args), - }; -} - -let initialized = false; - -export function init() { - if (initialized) { - return; - } - initialized = true; - - initializeRuntime(); - - if (globalThis.__RUNTIME_KIND !== RuntimeKind.ReactNative) { - initializeWorkletRuntime(); - } else { - initializeRNRuntime(); - installRNBindingsOnUIRuntime(); - } -} - -/** A function that should be run on any kind of runtime. */ -function initializeRuntime() { - if (globalThis._WORKLETS_BUNDLE_MODE) { - globalThis.__valueUnpacker = bundleValueUnpacker as ValueUnpacker; - } - installSynchronizableUnpacker(); - installCustomSerializableUnpacker(); -} - -/** A function that should be run only on React Native runtime. */ -function initializeRNRuntime() { - if (__DEV__) { - const testWorklet = () => { - 'worklet'; - }; - if (!isWorkletFunction(testWorklet)) { - throw new WorkletsError( - `Failed to create a worklet. See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#failed-to-create-a-worklet for more details.` - ); - } - } - - registerReportFatalRemoteError(); -} - -/** A function that should be run only on Worklet runtimes. */ -function initializeWorkletRuntime() { - if (globalThis._WORKLETS_BUNDLE_MODE) { - setupCallGuard(); - - if (__DEV__) { - /* - * Temporary workaround for Metro bundler. We must implement a dummy - * Refresh module to prevent Metro from throwing irrelevant errors. - */ - const Refresh = new Proxy( - {}, - { - get() { - return () => {}; - }, - } - ); - - globalThis.__r.Refresh = Refresh; - - /* Gracefully handle unwanted imports from React Native. */ - const modules = require.getModules(); - const ReactNativeModuleId = require.resolveWeak('react-native'); - - const factory = function ( - _global: unknown, - _require: unknown, - _importDefault: unknown, - _importAll: unknown, - module: Record, - _exports: unknown, - _dependencyMap: unknown - ) { - module.exports = new Proxy( - {}, - { - get: function get(_target, prop) { - globalThis.console.warn( - `You tried to import '${String(prop)}' from 'react-native' module on a Worklet Runtime. Using 'react-native' module on a Worklet Runtime is not allowed.` - ); - return { - get() { - return undefined; - }, - }; - }, - } - ); - }; - - const mod = { - dependencyMap: [], - factory, - hasError: false, - importedAll: {}, - importedDefault: {}, - isInitialized: false, - publicModule: { - exports: {}, - }, - }; - - modules.set(ReactNativeModuleId, mod); - } - } -} - -/** - * A function that should be run on the RN Runtime to configure the UI Runtime - * with callback bindings. - */ -function installRNBindingsOnUIRuntime() { - if (!WorkletsModule) { - throw new WorkletsError( - 'Worklets are trying to initialize the UI runtime without a valid WorkletsModule' - ); - } - - const runtimeBoundCapturableConsole = getMemorySafeCapturableConsole(); - - if (!globalThis._WORKLETS_BUNDLE_MODE) { - /** In bundle mode Runtimes setup their callGuard themselves. */ - runOnUISync(setupCallGuard); - - /** - * Register WorkletsError in the UI runtime global scope. (we are using - * `executeOnUIRuntimeSync` here to make sure that the changes are applied - * before any async operations are executed on the UI runtime). - * - * There's no need to register the error in bundle mode. - */ - runOnUISync(registerWorkletsError); - } - - runOnUISync(() => { - 'worklet'; - - setupConsole(runtimeBoundCapturableConsole); - /** - * TODO: Move `setupMicrotasks` and `setupRequestAnimationFrame` to a - * separate function once we have a better way to distinguish between - * Worklet Runtimes. - */ - setupMicrotasks(); - setupRequestAnimationFrame(); - setupSetTimeout(); - setupSetImmediate(); - setupSetInterval(); - }); -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/initializers/initializers.ts b/frontend-admin/node_modules/react-native-worklets/src/initializers/initializers.ts deleted file mode 100644 index 3ba7bc91..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/initializers/initializers.ts +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -import { IS_JEST } from '../platformChecker'; -import { mockedRequestAnimationFrame } from '../runLoop/uiRuntime/mockedRequestAnimationFrame'; -import { RuntimeKind } from '../runtimeKind'; - -export function init() { - globalThis._WORKLET = false; - globalThis.__RUNTIME_KIND = RuntimeKind.ReactNative; - globalThis._log = console.log; - globalThis._getAnimationTimestamp = () => performance.now(); - if (IS_JEST) { - // requestAnimationFrame react-native jest's setup is incorrect as it polyfills - // the method directly using setTimeout, therefore the callback doesn't get the - // expected timestamp as the only argument: https://github.com/facebook/react-native/blob/main/packages/react-native/jest/setup.js#L28 - // We override this setup here to make sure that callbacks get the proper timestamps - // when executed. For non-jest environments we define requestAnimationFrame in setupRequestAnimationFrame - // @ts-ignore TypeScript uses Node definition for rAF, setTimeout, etc which returns a Timeout object rather than a number - globalThis.requestAnimationFrame = mockedRequestAnimationFrame; - } -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/initializers/workletRuntimeEntry.native.ts b/frontend-admin/node_modules/react-native-worklets/src/initializers/workletRuntimeEntry.native.ts deleted file mode 100644 index d1a52ad6..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/initializers/workletRuntimeEntry.native.ts +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -import { WorkletsError } from '../debug/WorkletsError'; -import { RuntimeKind } from '../runtimeKind'; -import { init } from './initializers'; - -/** - * This function is an entry point for Worklet Runtimes. We can use it to setup - * necessary tools, like the ValueUnpacker. - * - * We must throw an error at the end of this function to prevent the bundle to - * continue executing. This is because the next module to be ran would be the - * React Native one, and it would break the Worklet Runtime if initialized. The - * error is caught in C++ code. - * - * This function has no effect on the RN Runtime beside setting the - * `_WORKLETS_BUNDLE_MODE` flag. - */ -export function bundleModeInit() { - // Worklets Babel Plugin replaces `false` with `true` here - // when Bundle Mode is enabled. - globalThis._WORKLETS_BUNDLE_MODE = false; - - if (!globalThis._WORKLETS_BUNDLE_MODE) { - return; - } - - const runtimeKind = globalThis.__RUNTIME_KIND; - if (runtimeKind && runtimeKind !== RuntimeKind.ReactNative) { - /** - * We shouldn't call `init()` on RN Runtime here, as it would initialize our - * module before React Native has configured the RN Runtime. - */ - init(); - throw new WorkletsError('Worklets initialized successfully'); - } -} - -bundleModeInit(); diff --git a/frontend-admin/node_modules/react-native-worklets/src/initializers/workletRuntimeEntry.ts b/frontend-admin/node_modules/react-native-worklets/src/initializers/workletRuntimeEntry.ts deleted file mode 100644 index 1fd651da..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/initializers/workletRuntimeEntry.ts +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -export function bundleModeInit() { - // no-op -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/memory/bundleUnpacker.native.ts b/frontend-admin/node_modules/react-native-worklets/src/memory/bundleUnpacker.native.ts deleted file mode 100644 index 5eba194f..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/memory/bundleUnpacker.native.ts +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - -import { logger } from '../debug/logger'; -import { WorkletsError } from '../debug/WorkletsError'; -import type { WorkletFactory, WorkletFunction } from '../types'; - -const handleCache = new WeakMap(); - -export function bundleValueUnpacker( - objectToUnpack: ObjectToUnpack, - category?: string, - remoteFunctionName?: string -): unknown { - const workletHash = objectToUnpack.__workletHash; - if (workletHash !== undefined) { - return getWorklet(workletHash, objectToUnpack.__closure); - } else if (objectToUnpack.__init !== undefined) { - let value = handleCache.get(objectToUnpack); - if (value === undefined) { - value = objectToUnpack.__init(); - handleCache.set(objectToUnpack, value); - } - return value; - } else if (category === 'RemoteFunction') { - const remoteFunctionHolder = () => { - const label = remoteFunctionName - ? `function \`${remoteFunctionName}\`` - : 'anonymous function'; - throw new WorkletsError(`Tried to synchronously call a non-worklet ${label} on the UI thread. -See https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#tried-to-synchronously-call-a-non-worklet-function-on-the-ui-thread for more details.`); - }; - remoteFunctionHolder.__remoteFunction = objectToUnpack; - return remoteFunctionHolder; - } else { - throw new WorkletsError( - `Data type in category "${category}" not recognized by value unpacker: "${globalThis._toString( - objectToUnpack - )}".` - ); - } -} - -function getWorklet( - workletHash: number, - closureVariables: Record -): WorkletFunction | undefined { - let worklet; - if (__DEV__) { - try { - worklet = getWorkletFromMetroRequire(workletHash, closureVariables); - } catch (_e) { - logger.error( - 'Unable to resolve worklet with hash ' + - workletHash + - '. Try reloading the app.' - ); - } - } else { - worklet = getWorkletFromMetroRequire(workletHash, closureVariables); - } - return worklet; -} - -const metroRequire = globalThis.__r; - -function getWorkletFromMetroRequire( - workletHash: number, - closureVariables: Record -): WorkletFunction { - const factory = metroRequire(workletHash).default as WorkletFactory; - return factory(closureVariables); -} - -interface ObjectToUnpack extends WorkletFunction { - _recur: unknown; -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/memory/customSerializableUnpacker.native.ts b/frontend-admin/node_modules/react-native-worklets/src/memory/customSerializableUnpacker.native.ts deleted file mode 100644 index ad362d83..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/memory/customSerializableUnpacker.native.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* eslint-disable reanimated/use-worklets-error */ -'use strict'; - -export function __installUnpacker() { - if (!globalThis.__customSerializationRegistry) { - globalThis.__customSerializationRegistry = - [] as typeof globalThis.__customSerializationRegistry; - } - const registry = globalThis.__customSerializationRegistry; - - function customSerializableUnpacker(value: TValue, typeId: number) { - const data = registry[typeId]; - if (!data) { - throw new Error( - `[Worklets] No custom serializable registered for type ID ${typeId}.` - ); - } - - return data.unpack(value as object); - } - - globalThis.__customSerializableUnpacker = - customSerializableUnpacker as CustomSerializableUnpacker; -} - -export type CustomSerializableUnpacker = ( - object: unknown, - typeId: number -) => unknown; diff --git a/frontend-admin/node_modules/react-native-worklets/src/memory/isSynchronizable.native.ts b/frontend-admin/node_modules/react-native-worklets/src/memory/isSynchronizable.native.ts deleted file mode 100644 index 4f3b9fe5..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/memory/isSynchronizable.native.ts +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -import type { Synchronizable } from './types'; - -export function isSynchronizable( - value: unknown -): value is Synchronizable { - 'worklet'; - return ( - typeof value === 'object' && - value !== null && - '__synchronizableRef' in value && - value.__synchronizableRef === true - ); -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/memory/isSynchronizable.ts b/frontend-admin/node_modules/react-native-worklets/src/memory/isSynchronizable.ts deleted file mode 100644 index 7c7c6979..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/memory/isSynchronizable.ts +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -import { WorkletsError } from '../debug/WorkletsError'; -import type { Synchronizable } from './types'; - -export function isSynchronizable( - _value: unknown -): _value is Synchronizable { - throw new WorkletsError('`isSynchronizable` is not supported on web.'); -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/memory/serializable.native.ts b/frontend-admin/node_modules/react-native-worklets/src/memory/serializable.native.ts deleted file mode 100644 index 1b5f5790..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/memory/serializable.native.ts +++ /dev/null @@ -1,897 +0,0 @@ -'use strict'; - -import { registerWorkletStackDetails } from '../debug/errors'; -import { jsVersion } from '../debug/jsVersion'; -import { logger } from '../debug/logger'; -import { WorkletsError } from '../debug/WorkletsError'; -import { getRuntimeKind, RuntimeKind } from '../runtimeKind'; -import type { WorkletFunction, WorkletImport } from '../types'; -import { isWorkletFunction } from '../workletFunction'; -import { WorkletsModule } from '../WorkletsModule/NativeWorklets'; -import { isSynchronizable } from './isSynchronizable'; -import { - serializableMappingCache, - serializableMappingFlag, -} from './serializableMappingCache'; -import type { - FlatSerializableRef, - RegistrationData, - SerializableRef, - SerializationData, - Synchronizable, -} from './types'; - -const MAGIC_KEY = 'REANIMATED_MAGIC_KEY'; - -function isHostObject(value: NonNullable) { - 'worklet'; - // We could use JSI to determine whether an object is a host object, however - // the below workaround works well and is way faster than an additional JSI call. - // We use the fact that host objects have broken implementation of `hasOwnProperty` - // and hence return true for all `in` checks regardless of the key we ask for. - return MAGIC_KEY in value; -} - -export function isSerializableRef( - value: unknown -): value is SerializableRef { - 'worklet'; - return ( - typeof value === 'object' && - value !== null && - '__serializableRef' in value && - value.__serializableRef === true - ); -} - -function isPlainJSObject(object: object): object is Record { - 'worklet'; - return Object.getPrototypeOf(object) === Object.prototype; -} - -function isTurboModuleLike(object: object): object is Record { - return isHostObject(Object.getPrototypeOf(object)); -} - -function getFromCache(value: object) { - const cached = serializableMappingCache.get(value); - if (cached === serializableMappingFlag) { - // This means that `value` was already a clone and we should return it as is. - return value; - } - return cached; -} - -// The below object is used as a replacement for objects that cannot be transferred -// as serializable values. In createSerializable we detect if an object is of -// a plain Object.prototype and only allow such objects to be transferred. This lets -// us avoid all sorts of react internals from leaking into the UI runtime. To make it -// possible to catch errors when someone actually tries to access such object on the UI -// runtime, we use the below Proxy object which is instantiated on the UI runtime and -// throws whenever someone tries to access its fields. -const INACCESSIBLE_OBJECT = { - __init: () => { - 'worklet'; - return new Proxy( - {}, - { - get: (_: unknown, prop: string | symbol) => { - if ( - prop === '_isReanimatedSharedValue' || - prop === '__remoteFunction' || - prop === '__synchronizableRef' - ) { - // not very happy about this check here, but we need to allow for - // "inaccessible" objects to be tested with isSerializableRef check - // as it is being used in the mappers when extracting inputs recursively - // as well as with isRemoteFunction when cloning objects recursively. - // Apparently we can't check if a key exists there as HostObjects always - // return true for such tests, so the only possibility for us is to - // actually access that key and see if it is set to true. We therefore - // need to allow for this key to be accessed here. - return false; - } - throw new WorkletsError( - `Trying to access property \`${String( - prop - )}\` of an object which cannot be sent to the UI runtime.` - ); - }, - set: () => { - throw new WorkletsError( - 'Trying to write to an object which cannot be sent to the UI runtime.' - ); - }, - } - ); - }, -}; - -const VALID_ARRAY_VIEWS_NAMES = [ - 'Int8Array', - 'Uint8Array', - 'Uint8ClampedArray', - 'Int16Array', - 'Uint16Array', - 'Int32Array', - 'Uint32Array', - 'Float32Array', - 'Float64Array', - 'BigInt64Array', - 'BigUint64Array', - 'DataView', -]; - -const DETECT_CYCLIC_OBJECT_DEPTH_THRESHOLD = 30; -// Below variable stores object that we process in createSerializable at the specified depth. -// We use it to check if later on the function reenters with the same object -let processedObjectAtThresholdDepth: unknown; - -export function createSerializable( - value: TValue, - shouldPersistRemote = false, - depth = 0 -): SerializableRef { - detectCyclicObject(value, depth); - - const isObject = typeof value === 'object'; - const isFunction = typeof value === 'function'; - - if (typeof value === 'string') { - return cloneString(value) as SerializableRef; - } - - if (typeof value === 'number') { - return cloneNumber(value) as SerializableRef; - } - - if (typeof value === 'boolean') { - return cloneBoolean(value) as SerializableRef; - } - - if (typeof value === 'bigint') { - return cloneBigInt(value) as SerializableRef; - } - - if (value === undefined) { - return cloneUndefined() as SerializableRef; - } - - if (value === null) { - return cloneNull() as SerializableRef; - } - - if ((!isObject && !isFunction) || value === null) { - return clonePrimitive(value, shouldPersistRemote); - } - - const cached = getFromCache(value); - if (cached !== undefined) { - return cached as SerializableRef; - } - - if (Array.isArray(value)) { - return cloneArray(value, shouldPersistRemote, depth); - } - if ( - globalThis._WORKLETS_BUNDLE_MODE && - isFunction && - (value as WorkletImport).__bundleData - ) { - return cloneImport(value as WorkletImport) as SerializableRef; - } - if (isFunction && !isWorkletFunction(value)) { - return cloneRemoteFunction(value); - } - // RN has introduced a new representation of TurboModules as a JS object whose prototype is the host object - // More details: https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp#L182 - if (isTurboModuleLike(value)) { - return cloneTurboModuleLike(value, shouldPersistRemote, depth); - } - if (isHostObject(value)) { - return cloneHostObject(value); - } - if (isPlainJSObject(value) && value.__init) { - return cloneInitializer( - value, - shouldPersistRemote, - depth - ) as SerializableRef; - } - if (isPlainJSObject(value) && value.__workletContextObjectFactory) { - return cloneContextObject(value); - } - if ((isPlainJSObject(value) || isFunction) && isWorkletFunction(value)) { - return cloneWorklet(value, shouldPersistRemote, depth); - } - if (isSynchronizable(value)) { - return cloneSynchronizable(value) as SerializableRef; - } - if (isPlainJSObject(value) || isFunction) { - return clonePlainJSObject(value, shouldPersistRemote, depth); - } - if (value instanceof Set) { - return cloneSet(value); - } - if (value instanceof Map) { - return cloneMap(value); - } - if (value instanceof RegExp) { - return cloneRegExp(value); - } - if (value instanceof Error) { - return cloneError(value); - } - if (value instanceof ArrayBuffer) { - return cloneArrayBuffer(value, shouldPersistRemote); - } - if (ArrayBuffer.isView(value)) { - // typed array (e.g. Int32Array, Uint8ClampedArray) or DataView - return cloneArrayBufferView(value); - } - for (let i = 0; i < customSerializationRegistry.length; i++) { - const { determine, pack } = customSerializationRegistry[i]; - if (determine(value)) { - return cloneCustom(value, pack, i) as SerializableRef; - } - } - return inaccessibleObject(value); -} - -if (globalThis._WORKLETS_BUNDLE_MODE) { - // TODO: Do it programmatically. - createSerializable.__bundleData = { - imported: 'createSerializable', - source: require.resolveWeak('react-native-worklets'), - }; -} - -if (!globalThis.__customSerializationRegistry) { - globalThis.__customSerializationRegistry = - [] as typeof globalThis.__customSerializationRegistry; -} -const customSerializationRegistry = globalThis.__customSerializationRegistry; - -/** - * `registerCustomSerializable` lets you register your own pre-serialization and - * post-deserialization logic. This is necessary for objects with prototypes - * different than just `Object.prototype` or some other built-in prototypes like - * `Map` etc. Worklets can't handle such objects by default to convert into - * [Serializables](https://docs.swmansion.com/react-native-worklets/docs/memory/serializable) - * hence you need to register them as **Custom Serializables**. This way you can - * tell Worklets how to transfer your custom data structures between different - * Runtimes without manually serializing and deserializing them every time. - * - * @param registrationData - The registration data for the custom serializable - - * {@link RegistrationData} - * @see https://docs.swmansion.com/react-native-worklets/docs/memory/registerCustomSerializable/ - */ -export function registerCustomSerializable< - TValue extends object, - TPacked extends object, ->(registrationData: RegistrationData) { - if (__DEV__ && getRuntimeKind() !== RuntimeKind.ReactNative) { - throw new WorkletsError( - 'registerCustomSerializable can be used only on React Native runtime.' - ); - } - - const { name, determine, pack, unpack } = registrationData; - - if (__DEV__) { - verifyRegistrationData(determine, pack, unpack); - } - if (customSerializationRegistry.some((data) => data.name === name)) { - if (__DEV__) { - console.warn( - `Custom serializable with name "${name}" is already registered. Duplicate registration is ignored.` - ); - } - return; - } - - customSerializationRegistry.push( - registrationData as unknown as SerializationData - ); - - WorkletsModule.registerCustomSerializable( - createSerializable(determine), - createSerializable(pack), - createSerializable(unpack), - customSerializationRegistry.length - 1 - ); -} - -function verifyRegistrationData( - determine: unknown, - pack: unknown, - unpack: unknown -) { - if (!isWorkletFunction(determine)) { - throw new WorkletsError( - 'The "determine" function provided to registerCustomSerializable must be a worklet.' - ); - } - if (!isWorkletFunction(pack)) { - throw new WorkletsError( - 'The "pack" function provided to registerCustomSerializable must be a worklet.' - ); - } - if (!isWorkletFunction(unpack)) { - throw new WorkletsError( - 'The "unpack" function provided to registerCustomSerializable must be a worklet.' - ); - } -} - -function detectCyclicObject(value: unknown, depth: number) { - if (depth >= DETECT_CYCLIC_OBJECT_DEPTH_THRESHOLD) { - // if we reach certain recursion depth we suspect that we are dealing with a cyclic object. - // this type of objects are not supported and cannot be transferred as serializable, so we - // implement a simple detection mechanism that remembers the value at a given depth and - // tests whether we try reenter this method later on with the same value. If that happens - // we throw an appropriate error. - if (depth === DETECT_CYCLIC_OBJECT_DEPTH_THRESHOLD) { - processedObjectAtThresholdDepth = value; - } else if (value === processedObjectAtThresholdDepth) { - throw new WorkletsError( - 'Trying to convert a cyclic object to a serializable. This is not supported.' - ); - } - } else { - processedObjectAtThresholdDepth = undefined; - } -} - -function clonePrimitive( - value: T, - shouldPersistRemote: boolean -): SerializableRef { - return WorkletsModule.createSerializable(value, shouldPersistRemote); -} - -function cloneString(value: string): SerializableRef { - return WorkletsModule.createSerializableString(value); -} - -function cloneNumber(value: number): SerializableRef { - return WorkletsModule.createSerializableNumber(value); -} - -function cloneBoolean(value: boolean): SerializableRef { - return WorkletsModule.createSerializableBoolean(value); -} - -function cloneBigInt(value: bigint): SerializableRef { - return WorkletsModule.createSerializableBigInt(value); -} - -function cloneUndefined(): SerializableRef { - return WorkletsModule.createSerializableUndefined(); -} - -function cloneNull(): SerializableRef { - return WorkletsModule.createSerializableNull(); -} - -function cloneObjectProperties( - value: T, - shouldPersistRemote: boolean, - depth: number -): Record { - const clonedProps: Record = {}; - for (const [key, element] of Object.entries(value)) { - // We don't need to clone __initData field as it contains long strings - // representing the worklet code, source map, and location, and we will - // serialize/deserialize it once. - if (key === '__initData' && clonedProps.__initData !== undefined) { - continue; - } - clonedProps[key] = createSerializable( - element, - shouldPersistRemote, - depth + 1 - ); - } - return clonedProps; -} - -function cloneInitializer( - value: object, - shouldPersistRemote = false, - depth = 0 -): SerializableRef { - const clonedProps: Record = cloneObjectProperties( - value, - shouldPersistRemote, - depth - ); - return WorkletsModule.createSerializableInitializer(clonedProps); -} - -function cloneArray( - value: T, - shouldPersistRemote: boolean, - depth: number -): SerializableRef { - const clonedElements = value.map((element) => - createSerializable(element, shouldPersistRemote, depth + 1) - ); - const clone = WorkletsModule.createSerializableArray( - clonedElements, - shouldPersistRemote - ) as SerializableRef; - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - - freezeObjectInDev(value); - return clone; -} - -function cloneRemoteFunction( - value: (...args: TArgs) => TReturn -): SerializableRef { - const clone = WorkletsModule.createSerializableFunction(value); - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - - freezeObjectInDev(value); - return clone; -} - -function cloneHostObject(value: T): SerializableRef { - // for host objects we pass the reference to the object as serializable and - // then recreate new host object wrapping the same instance on the UI thread. - // there is no point of iterating over keys as we do for regular objects. - const clone = WorkletsModule.createSerializableHostObject(value); - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - - return clone; -} - -function cloneWorklet( - value: TValue, - shouldPersistRemote: boolean, - depth: number -): SerializableRef { - if (__DEV__) { - const babelVersion = (value as WorkletFunction).__pluginVersion; - if (babelVersion !== undefined && babelVersion !== jsVersion) { - throw new WorkletsError( - `Mismatch between JavaScript code version and Worklets Babel plugin version (${jsVersion} vs. ${babelVersion}). - See \`https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#mismatch-between-javascript-code-version-and-worklets-babel-plugin-version\` for more details. - Offending code was: \`${getWorkletCode(value)}\`` - ); - } - registerWorkletStackDetails( - value.__workletHash, - (value as WorkletFunction).__stackDetails! - ); - } - if ((value as WorkletFunction).__stackDetails) { - // `Error` type of value cannot be copied to the UI thread, so we - // remove it after we handled it in dev mode or delete it to ignore it in production mode. - // Not removing this would cause an infinite loop in production mode and it just - // seems more elegant to handle it this way. - delete (value as WorkletFunction).__stackDetails; - } - const clonedProps: Record = cloneObjectProperties( - value, - true, - depth - ); - // to save on transferring static __initData field of worklet structure - // we request serializable value to persist its UI counterpart. This means - // that the __initData field that contains long strings representing the - // worklet code, source map, and location, will always be - // serialized/deserialized once. - clonedProps.__initData = createSerializable( - value.__initData, - true, - depth + 1 - ); - - const clone = WorkletsModule.createSerializableWorklet( - clonedProps, - // TODO: Check after refactor if we can remove shouldPersistRemote parameter (imho it's redundant here since worklets are always persistent) - // retain all worklets - true - ) as SerializableRef; - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - - freezeObjectInDev(value); - return clone; -} - -/** - * TurboModuleLike objects are JS objects that have a TurboModule as their - * prototype. - */ -function cloneTurboModuleLike( - value: TValue, - shouldPersistRemote: boolean, - depth: number -): SerializableRef { - const proto = Object.getPrototypeOf(value); - const clonedProps = cloneObjectProperties(value, shouldPersistRemote, depth); - const clone = WorkletsModule.createSerializableTurboModuleLike( - clonedProps, - proto - ) as SerializableRef; - return clone; -} - -function cloneContextObject( - value: TValue -): SerializableRef { - const workletContextObjectFactory = (value as Record) - .__workletContextObjectFactory as () => TValue; - const handle = cloneInitializer({ - __init: () => { - 'worklet'; - return workletContextObjectFactory(); - }, - }); - serializableMappingCache.set(value, handle); - return handle as SerializableRef; -} - -function clonePlainJSObject( - value: TValue, - shouldPersistRemote: boolean, - depth: number -): SerializableRef { - const clonedProps: Record = cloneObjectProperties( - value, - shouldPersistRemote, - depth - ); - const clone = WorkletsModule.createSerializableObject( - clonedProps, - shouldPersistRemote, - value - ) as SerializableRef; - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - - freezeObjectInDev(value); - return clone; -} - -function cloneMap>( - value: TValue -): SerializableRef { - const clonedKeys: unknown[] = []; - const clonedValues: unknown[] = []; - for (const [key, element] of value.entries()) { - clonedKeys.push(createSerializable(key)); - clonedValues.push(createSerializable(element)); - } - const clone = WorkletsModule.createSerializableMap( - clonedKeys, - clonedValues - ) as SerializableRef; - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - - freezeObjectInDev(value); - return clone; -} - -function cloneSet>( - value: TValue -): SerializableRef { - const clonedElements: unknown[] = []; - for (const element of value) { - clonedElements.push(createSerializable(element)); - } - const clone = WorkletsModule.createSerializableSet( - clonedElements - ) as SerializableRef; - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - - freezeObjectInDev(value); - return clone; -} - -function cloneRegExp( - value: TValue -): SerializableRef { - const pattern = value.source; - const flags = value.flags; - const handle = cloneInitializer({ - __init: () => { - 'worklet'; - return new RegExp(pattern, flags); - }, - }) as unknown as SerializableRef; - serializableMappingCache.set(value, handle); - - return handle; -} - -function cloneError( - value: TValue -): SerializableRef { - const { name, message, stack } = value; - const handle = cloneInitializer({ - __init: () => { - 'worklet'; - // eslint-disable-next-line reanimated/use-worklets-error - const error = new Error(); - error.name = name; - error.message = message; - error.stack = stack; - return error; - }, - }); - serializableMappingCache.set(value, handle); - return handle as unknown as SerializableRef; -} - -function cloneArrayBuffer( - value: T, - shouldPersistRemote: boolean -): SerializableRef { - const clone = WorkletsModule.createSerializable( - value, - shouldPersistRemote, - value - ); - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - - return clone; -} - -function cloneArrayBufferView( - value: TValue -): SerializableRef { - const buffer = value.buffer; - const typeName = value.constructor.name; - const handle = cloneInitializer({ - __init: () => { - 'worklet'; - if (!VALID_ARRAY_VIEWS_NAMES.includes(typeName)) { - throw new WorkletsError(`Invalid array view name \`${typeName}\`.`); - } - const constructor = global[typeName as keyof typeof global]; - if (constructor === undefined) { - throw new WorkletsError(`Constructor for \`${typeName}\` not found.`); - } - return new constructor(buffer); - }, - }) as unknown as SerializableRef; - serializableMappingCache.set(value, handle); - - return handle; -} - -function cloneSynchronizable( - value: Synchronizable -): SerializableRef { - serializableMappingCache.set(value); - return value; -} - -function cloneImport( - value: TValue -): SerializableRef { - const { source, imported } = value.__bundleData; - const clone = WorkletsModule.createSerializableImport(source, imported); - - serializableMappingCache.set(value, clone); - serializableMappingCache.set(clone); - - return clone as SerializableRef; -} - -function cloneCustom( - data: TValue, - pack: (data: TValue) => TPacked, - typeId: number -): SerializableRef { - const packedData = pack(data); - const serialized = createSerializable(packedData); - - return WorkletsModule.createCustomSerializable( - serialized, - typeId - ) as SerializableRef; -} - -function inaccessibleObject( - value: TValue -): SerializableRef { - // This is reached for object types that are not of plain Object.prototype. - // We don't support such objects from being transferred as serializables to - // the UI runtime and hence we replace them with "inaccessible object" - // which is implemented as a Proxy object that throws on any attempt - // of accessing its fields. We argue that such objects can sometimes leak - // as attributes of objects being captured by worklets but should never - // be used on the UI runtime regardless. If they are being accessed, the user - // will get an appropriate error message. - const clone = createSerializable(INACCESSIBLE_OBJECT as TValue); - serializableMappingCache.set(value, clone); - return clone; -} - -const WORKLET_CODE_THRESHOLD = 255; - -function getWorkletCode(value: WorkletFunction) { - const code = value?.__initData?.code; - if (!code) { - return 'unknown'; - } - if (code.length > WORKLET_CODE_THRESHOLD) { - return `${code.substring(0, WORKLET_CODE_THRESHOLD)}...`; - } - return code; -} - -type RemoteFunction = { - __remoteFunction: FlatSerializableRef; -}; - -function isRemoteFunction(value: { - __remoteFunction?: unknown; -}): value is RemoteFunction { - 'worklet'; - return !!value.__remoteFunction; -} - -/** - * We freeze - * - * - Arrays, - * - Remote functions, - * - Plain JS objects, - * - * That are transformed to a serializable with a meaningful warning. This should - * help detect issues when someone modifies data after it's been converted. - * Meaning that they may be doing a faulty assumption in their code expecting - * that the updates are going to automatically propagate to the object sent to - * the UI thread. If the user really wants some objects to be mutable they - * should use shared values instead. - */ -function freezeObjectInDev(value: TValue) { - if (!__DEV__ || globalThis.__RUNTIME_KIND !== RuntimeKind.ReactNative) { - return; - } - Object.entries(value).forEach(([key, element]) => { - const descriptor = Object.getOwnPropertyDescriptor(value, key)!; - if (!descriptor.configurable) { - return; - } - Object.defineProperty(value, key, { - get() { - return element; - }, - set() { - logger.warn( - `Tried to modify key \`${key}\` of an object which has been already passed to a worklet. See - https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#tried-to-modify-key-of-an-object-which-has-been-converted-to-a-serializable - for more details.` - ); - }, - }); - }); - Object.preventExtensions(value); -} - -function makeShareableCloneOnUIRecursiveLEGACY( - value: TValue -): FlatSerializableRef { - 'worklet'; - // eslint-disable-next-line @typescript-eslint/no-shadow - function cloneRecursive(value: TValue): FlatSerializableRef { - if ( - (typeof value === 'object' && value !== null) || - typeof value === 'function' - ) { - if (isHostObject(value)) { - // We call `_createSerializableClone` to wrap the provided HostObject - // inside SerializableJSRef. - return global._createSerializableHostObject( - value - ) as FlatSerializableRef; - } - if (isRemoteFunction(value)) { - // RemoteFunctions are created by us therefore they are - // a Serializable out of the box and there is no need to - // call `_createSerializableClone`. - return value.__remoteFunction; - } - if (Array.isArray(value)) { - return global._createSerializableArray( - value.map(cloneRecursive) - ) as FlatSerializableRef; - } - if ((value as Record).__synchronizableRef) { - return global._createSerializableSynchronizable( - value - ) as FlatSerializableRef; - } - if (Object.getPrototypeOf(value) !== Object.prototype) { - const length = globalThis.__customSerializationRegistry.length; - for (let i = 0; i < length; i++) { - const { determine, pack } = - globalThis.__customSerializationRegistry[i]; - if (determine(value)) { - const packedData = pack(value); - return globalThis.__workletsModuleProxy?.createCustomSerializable( - cloneRecursive(packedData as TValue) as SerializableRef, - i - ) as FlatSerializableRef; - } - } - } - const toAdapt: Record> = {}; - for (const [key, element] of Object.entries(value)) { - toAdapt[key] = cloneRecursive(element); - } - return global._createSerializable( - toAdapt, - value - ) as FlatSerializableRef; - } - - if (typeof value === 'string') { - return global._createSerializableString(value); - } - - if (typeof value === 'number') { - return global._createSerializableNumber(value); - } - - if (typeof value === 'boolean') { - return global._createSerializableBoolean(value); - } - - if (typeof value === 'bigint') { - return global._createSerializableBigInt(value); - } - - if (value === undefined) { - return global._createSerializableUndefined(); - } - - if (value === null) { - return global._createSerializableNull(); - } - - return global._createSerializable(value, undefined); - } - return cloneRecursive(value); -} - -/** @deprecated This function is no longer supported. */ -export const makeShareableCloneOnUIRecursive = ( - globalThis._WORKLETS_BUNDLE_MODE - ? createSerializable - : makeShareableCloneOnUIRecursiveLEGACY -) as typeof makeShareableCloneOnUIRecursiveLEGACY; - -/** - * This function creates a value on UI with persistent state - changes to it on - * the UI thread will be seen by all worklets. Use it when you want to create a - * value that is read and written only on the UI thread. - * - * @deprecated This function is no longer supported. - */ -export function makeShareable(value: TValue): TValue { - if (serializableMappingCache.get(value)) { - return value; - } - const handle = createSerializable({ - __init: () => { - 'worklet'; - return value; - }, - }); - serializableMappingCache.set(value, handle); - return value; -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/memory/serializable.ts b/frontend-admin/node_modules/react-native-worklets/src/memory/serializable.ts deleted file mode 100644 index a7c222cb..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/memory/serializable.ts +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -import type { - FlatSerializableRef, - RegistrationData, - SerializableRef, -} from './types'; - -export function isSerializableRef( - value: unknown -): value is SerializableRef { - return true; -} - -export function createSerializable( - value: TValue -): SerializableRef { - return value as SerializableRef; -} - -export function makeShareableCloneOnUIRecursive( - value: TValue -): FlatSerializableRef { - return value as FlatSerializableRef; -} - -export function makeShareable(value: TValue): TValue { - return value; -} - -export function registerCustomSerializable< - TValue extends object, - TPacked extends object, ->(_registrationData: RegistrationData) { - // noop -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/memory/serializableMappingCache.native.ts b/frontend-admin/node_modules/react-native-worklets/src/memory/serializableMappingCache.native.ts deleted file mode 100644 index f2701943..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/memory/serializableMappingCache.native.ts +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -import type { SerializableRef } from './types'; - -/** - * This symbol is used to represent a mapping from the value to itself. - * - * It's used to prevent converting a serializable that's already converted - for - * example a Shared Value that's in worklet's closure. - */ -export const serializableMappingFlag = Symbol('serializable flag'); - -/* -During a fast refresh, React holds the same instance of a Mutable -(that's guaranteed by `useRef`) but `serializableCache` gets regenerated and thus -becoming empty. This happens when editing the file that contains the definition of this cache. - -Because of it, `createSerializable` can't find given mapping -in `serializableCache` for the Mutable and tries to clone it as if it was a regular JS object. -During cloning we use `Object.entries` to iterate over the keys which throws an error on accessing `_value`. -For convenience we moved this cache to a separate file so it doesn't scare us with red squiggles. -*/ - -const cache = new WeakMap(); - -export const serializableMappingCache = { - set(serializable: object, serializableRef?: SerializableRef): void { - cache.set(serializable, serializableRef || serializableMappingFlag); - }, - get: cache.get.bind(cache), -}; diff --git a/frontend-admin/node_modules/react-native-worklets/src/memory/serializableMappingCache.ts b/frontend-admin/node_modules/react-native-worklets/src/memory/serializableMappingCache.ts deleted file mode 100644 index 94a07059..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/memory/serializableMappingCache.ts +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -import type { SerializableRef } from './types'; - -export const serializableMappingCache = { - set(_serializable: object, _serializableRef?: SerializableRef): void { - // NOOP - }, - get(_key: object): object | symbol | SerializableRef { - return null!; - }, -}; diff --git a/frontend-admin/node_modules/react-native-worklets/src/memory/synchronizable.native.ts b/frontend-admin/node_modules/react-native-worklets/src/memory/synchronizable.native.ts deleted file mode 100644 index f763d5d4..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/memory/synchronizable.native.ts +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -import { WorkletsModule } from '../WorkletsModule/NativeWorklets'; -import { createSerializable } from './serializable'; -import type { Synchronizable } from './types'; - -export function createSynchronizable( - initialValue: TValue -): Synchronizable { - const synchronizableRef = WorkletsModule.createSynchronizable( - createSerializable(initialValue) - ); - - return globalThis.__synchronizableUnpacker( - synchronizableRef - ) as unknown as Synchronizable; -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/memory/synchronizable.ts b/frontend-admin/node_modules/react-native-worklets/src/memory/synchronizable.ts deleted file mode 100644 index 7a25de06..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/memory/synchronizable.ts +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -import { WorkletsError } from '../debug/WorkletsError'; -import type { Synchronizable } from './types'; - -export function createSynchronizable( - _value: TValue -): Synchronizable { - throw new WorkletsError('`createSynchronizable` is not supported on web.'); -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/memory/synchronizableUnpacker.native.ts b/frontend-admin/node_modules/react-native-worklets/src/memory/synchronizableUnpacker.native.ts deleted file mode 100644 index 523be941..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/memory/synchronizableUnpacker.native.ts +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -import { createSerializable } from './serializable'; -import { type Synchronizable, type SynchronizableRef } from './types'; - -export function __installUnpacker() { - // TODO: Add cache for synchronizables. - const serializer = - !globalThis._WORKLET || globalThis._WORKLETS_BUNDLE_MODE - ? (value: unknown, _: unknown) => createSerializable(value) - : globalThis._createSerializable; - - function synchronizableUnpacker( - synchronizableRef: SynchronizableRef - ): Synchronizable { - const synchronizable = - synchronizableRef as unknown as Synchronizable; - const proxy = globalThis.__workletsModuleProxy!; - - synchronizable.__synchronizableRef = true; - synchronizable.getDirty = () => { - return proxy.synchronizableGetDirty(synchronizable); - }; - synchronizable.getBlocking = () => { - return proxy.synchronizableGetBlocking(synchronizable); - }; - synchronizable.setBlocking = ( - valueOrFunction: TValue | ((prev: TValue) => TValue) - ) => { - let newValue: TValue; - if (typeof valueOrFunction === 'function') { - const func = valueOrFunction as (prev: TValue) => TValue; - synchronizable.lock(); - const prev = synchronizable.getBlocking(); - newValue = func(prev); - - proxy.synchronizableSetBlocking( - synchronizable, - serializer(newValue, undefined) - ); - - synchronizable.unlock(); - } else { - const value = valueOrFunction; - newValue = value; - proxy.synchronizableSetBlocking( - synchronizable, - serializer(newValue, undefined) - ); - } - }; - synchronizable.lock = () => { - proxy.synchronizableLock(synchronizable); - }; - synchronizable.unlock = () => { - proxy.synchronizableUnlock(synchronizable); - }; - - return synchronizable; - } - - globalThis.__synchronizableUnpacker = synchronizableUnpacker; -} - -export type SynchronizableUnpacker = ( - synchronizableRef: SynchronizableRef -) => Synchronizable; diff --git a/frontend-admin/node_modules/react-native-worklets/src/memory/types.ts b/frontend-admin/node_modules/react-native-worklets/src/memory/types.ts deleted file mode 100644 index 488125e3..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/memory/types.ts +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -/** - * The below type is used for HostObjects returned by the JSI API that don't - * have any accessible fields or methods but can carry data that is accessed - * from the c++ side. We add a field to the type to make it possible for - * typescript to recognize which JSI methods accept those types as arguments and - * to be able to correctly type check other methods that may use them. However, - * this field is not actually defined nor should be used for anything else as - * assigning any data to those objects will throw an error. - */ -export type SerializableRef = { - __serializableRef: true; - __nativeStateSerializableJSRef: TValue; -}; - -// In case of objects with depth or arrays of objects or arrays of arrays etc. -// we add this utility type that makes it a `SharaebleRef` of the outermost type. -export type FlatSerializableRef = - TValue extends SerializableRef - ? SerializableRef - : SerializableRef; - -export type SynchronizableRef = { - __synchronizableRef: true; - __nativeStateSynchronizableJSRef: TValue; -}; - -export type Synchronizable = SerializableRef & - SynchronizableRef & { - __synchronizableRef: true; - getDirty(): TValue; - getBlocking(): TValue; - setBlocking(value: TValue | ((prev: TValue) => TValue)): void; - lock(): void; - unlock(): void; - }; - -/** - * Registration data for - * [registerCustomSerializable](https://docs.swmansion.com/react-native-reanimated/docs/memory/registerCustomSerializable) - * function. - */ -export type RegistrationData = { - /** - * A unique name for the Custom Serializable. It's used to prevent duplicate - * registrations of the same Custom Serializable. You will get warned if you - * attempt to register a Custom Serializable with a name that has already been - * used. - */ - name: string; - /** - * A worklet that checks whether a given JavaScript value is of the type - * handled by this Custom Serializable. - */ - determine: (value: object) => value is TValue; - /** - * A worklet that packs the JavaScript value of type `TValue` into a value - * that can be serialized by default as Serializable. The function must return - * a [supported type for - * Serialization](https://docs.swmansion.com/react-native-reanimated/docs/memory/Serializable#supported-types). - */ - pack: (value: TValue) => TPacked; - /** - * A worklet that unpacks the packed value, after it's been deserialized from - * it's packed form, back into the JavaScript value of type `TValue`. - */ - unpack: (value: TPacked) => TValue; -}; - -export type SerializationData = Omit< - RegistrationData, - 'name' -> & { - /** Only defined on the RN Runtime. */ - name?: string; -}; - -export type CustomSerializationRegistry = SerializationData[]; diff --git a/frontend-admin/node_modules/react-native-worklets/src/memory/valueUnpacker.native.ts b/frontend-admin/node_modules/react-native-worklets/src/memory/valueUnpacker.native.ts deleted file mode 100644 index 5850da48..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/memory/valueUnpacker.native.ts +++ /dev/null @@ -1,92 +0,0 @@ -'use strict'; - -import type { ValueUnpacker, WorkletFunction } from '../types'; - -declare global { - var evalWithSourceMap: - | ((js: string, sourceURL: string, sourceMap: string) => () => unknown) - | undefined; - var evalWithSourceUrl: - | ((js: string, sourceURL: string) => () => unknown) - | undefined; -} - -function __installUnpacker() { - const workletsCache = new Map unknown>(); - const handleCache = new WeakMap(); - - function valueUnpacker( - objectToUnpack: ObjectToUnpack, - category?: string, - remoteFunctionName?: string - ): unknown { - // eslint-disable-next-line strict - 'use strict'; - const workletHash = objectToUnpack.__workletHash; - if (workletHash !== undefined) { - let workletFun = workletsCache.get(workletHash); - if (workletFun === undefined) { - const initData = objectToUnpack.__initData; - if (globalThis.evalWithSourceMap) { - // if the runtime (hermes only for now) supports loading source maps - // we want to use the proper filename for the location as it guarantees - // that debugger understands and loads the source code of the file where - // the worklet is defined. - workletFun = globalThis.evalWithSourceMap( - '(' + initData!.code + '\n)', - initData!.location!, - initData!.sourceMap! - ); - } else if (globalThis.evalWithSourceUrl) { - // if the runtime doesn't support loading source maps, in dev mode we - // can pass source url when evaluating the worklet. Now, instead of using - // the actual file location we use worklet hash, as it the allows us to - // properly symbolicate traces (see errors.ts for details) - workletFun = globalThis.evalWithSourceUrl( - '(' + initData!.code + '\n)', - `worklet_${workletHash}` - ); - } else { - // in release we use the regular eval to save on JSI calls - // eslint-disable-next-line no-eval - workletFun = eval('(' + initData!.code + '\n)'); - } - workletsCache.set(workletHash, workletFun!); - } - const functionInstance = workletFun!.bind(objectToUnpack); - objectToUnpack._recur = functionInstance; - return functionInstance; - } else if (objectToUnpack.__init !== undefined) { - let value = handleCache.get(objectToUnpack); - if (value === undefined) { - value = objectToUnpack.__init(); - handleCache.set(objectToUnpack, value); - } - return value; - } else if (category === 'RemoteFunction') { - const fun = () => { - const label = remoteFunctionName - ? `function \`${remoteFunctionName}\`` - : 'anonymous function'; - // eslint-disable-next-line reanimated/use-worklets-error - throw new Error(`[Worklets] Tried to synchronously call a non-worklet ${label} on the UI thread. -See https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#tried-to-synchronously-call-a-non-worklet-function-on-the-ui-thread for more details.`); - }; - fun.__remoteFunction = objectToUnpack; - return fun; - } else { - // eslint-disable-next-line reanimated/use-worklets-error - throw new Error( - `[Worklets] Data type in category "${category}" not recognized by value unpacker: "${globalThis._toString( - objectToUnpack - )}".` - ); - } - } - - globalThis.__valueUnpacker = valueUnpacker as ValueUnpacker; -} - -interface ObjectToUnpack extends WorkletFunction { - _recur: unknown; -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/mock.ts b/frontend-admin/node_modules/react-native-worklets/src/mock.ts deleted file mode 100644 index 4923ced9..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/mock.ts +++ /dev/null @@ -1,107 +0,0 @@ -'use strict'; - -import { mockedRequestAnimationFrame } from './runLoop/uiRuntime/mockedRequestAnimationFrame'; -import { RuntimeKind } from './runtimeKind'; -import { isWorkletFunction } from './workletFunction'; - -const NOOP = () => {}; -const NOOP_FACTORY = () => NOOP; -const ID = (value: TValue) => value; -const IMMEDIATE_CALLBACK_INVOCATION = (callback: () => TCallback) => - callback(); - -globalThis._WORKLET = false; -globalThis.__RUNTIME_KIND = RuntimeKind.ReactNative; -globalThis._log = console.log; -globalThis._getAnimationTimestamp = () => performance.now(); -// requestAnimationFrame react-native jest's setup is incorrect as it polyfills -// the method directly using setTimeout, therefore the callback doesn't get the -// expected timestamp as the only argument: https://github.com/facebook/react-native/blob/main/packages/react-native/jest/setup.js#L28 -// We override this setup here to make sure that callbacks get the proper timestamps -// when executed. For non-jest environments we define requestAnimationFrame in setupRequestAnimationFrame -// @ts-ignore TypeScript uses Node definition for rAF, setTimeout, etc which returns a Timeout object rather than a number -globalThis.requestAnimationFrame = mockedRequestAnimationFrame; - -const WorkletAPI = { - isShareableRef: () => true, - makeShareable: ID, - makeShareableCloneOnUIRecursive: ID, - makeShareableCloneRecursive: ID, - shareableMappingCache: new Map(), - getStaticFeatureFlag: () => false, - setDynamicFeatureFlag: NOOP, - isSynchronizable: () => false, - getRuntimeKind: () => RuntimeKind.ReactNative, - RuntimeKind: RuntimeKind, - createWorkletRuntime: NOOP_FACTORY, - runOnRuntime: ID, - scheduleOnRuntime: IMMEDIATE_CALLBACK_INVOCATION, - createSerializable: ID, - isSerializableRef: ID, - serializableMappingCache: new Map(), - createSynchronizable: ID, - callMicrotasks: NOOP, - executeOnUIRuntimeSync: ID, - runOnJS( - fun: (...args: Args) => ReturnValue - ): (...args: Args) => void { - return (...args) => - queueMicrotask( - args.length - ? () => (fun as (...args: Args) => ReturnValue)(...args) - : (fun as () => ReturnValue) - ); - }, - runOnUI( - worklet: (...args: Args) => ReturnValue - ): (...args: Args) => void { - return (...args) => { - // Mocking time in Jest is tricky as both requestAnimationFrame and queueMicrotask - // callbacks run on the same queue and can be interleaved. There is no way - // to flush particular queue in Jest and the only control over mocked timers - // is by using jest.advanceTimersByTime() method which advances all types - // of timers including immediate and animation callbacks. Ideally we'd like - // to have some way here to schedule work along with React updates, but - // that's not possible, and hence in Jest environment instead of using scheduling - // mechanism we just schedule the work ommiting the queue. This is ok for the - // uses that we currently have but may not be ok for future tests that we write. - mockedRequestAnimationFrame(() => { - worklet(...args); - }); - }; - }, - runOnUIAsync( - worklet: (...args: Args) => ReturnValue - ): (...args: Args) => Promise { - return (...args: Args) => { - return new Promise((resolve) => { - mockedRequestAnimationFrame(() => { - const result = worklet(...args); - resolve(result); - }); - }); - }; - }, - runOnUISync: IMMEDIATE_CALLBACK_INVOCATION, - scheduleOnRN( - fun: (...args: Args) => ReturnValue, - ...args: Args - ): void { - WorkletAPI.runOnJS(fun)(...args); - }, - scheduleOnUI( - worklet: (...args: Args) => ReturnValue, - ...args: Args - ): void { - WorkletAPI.runOnUI(worklet)(...args); - }, - // eslint-disable-next-line camelcase - unstable_eventLoopTask: NOOP_FACTORY, - isWorkletFunction: isWorkletFunction, - WorkletsModule: {}, -}; - -module.exports = { - __esModule: true, - ...WorkletAPI, -}; diff --git a/frontend-admin/node_modules/react-native-worklets/src/platformChecker.native.ts b/frontend-admin/node_modules/react-native-worklets/src/platformChecker.native.ts deleted file mode 100644 index 52aa24ab..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/platformChecker.native.ts +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -export const IS_JEST = false; diff --git a/frontend-admin/node_modules/react-native-worklets/src/platformChecker.ts b/frontend-admin/node_modules/react-native-worklets/src/platformChecker.ts deleted file mode 100644 index 96f78257..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/platformChecker.ts +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -import { Platform } from 'react-native'; - -export const IS_JEST: boolean = !!process.env.JEST_WORKER_ID; -export const IS_WEB: boolean = Platform.OS === 'web'; -export const IS_WINDOWS: boolean = Platform.OS === 'windows'; -export const SHOULD_BE_USE_WEB: boolean = IS_JEST || IS_WEB || IS_WINDOWS; diff --git a/frontend-admin/node_modules/react-native-worklets/src/privateGlobals.d.ts b/frontend-admin/node_modules/react-native-worklets/src/privateGlobals.d.ts index 7082c0f3..1b783344 100644 --- a/frontend-admin/node_modules/react-native-worklets/src/privateGlobals.d.ts +++ b/frontend-admin/node_modules/react-native-worklets/src/privateGlobals.d.ts @@ -1,15 +1,15 @@ +/* eslint-disable reanimated/use-global-this */ 'use strict'; // This file works by accident - currently Builder Bob doesn't move `.d.ts` files to output types. // If it ever breaks, we should address it so we'd not pollute the user's global namespace. import type { callGuardDEV } from './callGuard'; -import type { reportFatalRemoteError } from './debug/errors'; -import type { CustomSerializableUnpacker } from './memory/customSerializableUnpacker'; -import type { SynchronizableUnpacker } from './memory/synchronizableUnpacker'; -import type { CustomSerializationRegistry } from './memory/types'; +import type { reportFatalRemoteError } from './errors'; import type { Queue } from './runLoop/workletRuntime/taskQueue'; -import type { ValueUnpacker } from './types'; -import type { WorkletsModuleProxy } from './WorkletsModule/workletsModuleProxy'; +import type { SynchronizableUnpacker } from './synchronizableUnpacker'; +import type { IWorkletsErrorConstructor } from './WorkletsError'; +import type { WorkletsModuleProxy } from './WorkletsModule'; +import type { ValueUnpacker } from './workletTypes'; declare global { /** The only runtime-available require method is `__r` defined by Metro. */ @@ -61,8 +61,6 @@ declare global { var __reportFatalRemoteError: typeof reportFatalRemoteError | undefined; var __valueUnpacker: ValueUnpacker; var __synchronizableUnpacker: SynchronizableUnpacker; - var __customSerializationRegistry: CustomSerializationRegistry; - var __customSerializableUnpacker: CustomSerializableUnpacker; var __callGuardDEV: typeof callGuardDEV | undefined; var __flushAnimationFrame: (timestamp: number) => void; var __frameTimestamp: number | undefined; @@ -73,16 +71,9 @@ declare global { worklet: SerializableRef<() => void> ) => void; var _microtaskQueueFinalizers: (() => void)[]; + var WorkletsError: IWorkletsErrorConstructor; var _scheduleTimeoutCallback: (delay: number, handlerId: number) => void; var __runTimeoutCallback: (handlerId: number) => void; var __flushMicrotasks: () => void; var _taskQueue: Queue; - /** Only in Debug builds. */ - var __hasNativeState: (value: object) => boolean; - /** Only in Debug builds. */ - var __isHostObject: (value: object) => boolean; - interface NodeRequire { - resolveWeak(id: string): number; - getModules(): Map; - } } diff --git a/frontend-admin/node_modules/react-native-worklets/src/runtimes.native.ts b/frontend-admin/node_modules/react-native-worklets/src/runtimes.native.ts deleted file mode 100644 index bca57ac5..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/runtimes.native.ts +++ /dev/null @@ -1,198 +0,0 @@ -'use strict'; - -import { setupCallGuard } from './callGuard'; -import { registerWorkletsError, WorkletsError } from './debug/WorkletsError'; -import { - getMemorySafeCapturableConsole, - setupConsole, -} from './initializers/initializers'; -import { - createSerializable, - makeShareableCloneOnUIRecursive, -} from './memory/serializable'; -import { setupRunLoop } from './runLoop/workletRuntime'; -import { RuntimeKind } from './runtimeKind'; -import type { - WorkletFunction, - WorkletRuntime, - WorkletRuntimeConfig, -} from './types'; -import { isWorkletFunction } from './workletFunction'; -import { WorkletsModule } from './WorkletsModule/NativeWorklets'; - -/** - * Lets you create a new JS runtime which can be used to run worklets possibly - * on different threads than JS or UI thread. - * - * @param config - Runtime configuration object - {@link WorkletRuntimeConfig}. - * @returns WorkletRuntime which is a - * `jsi::HostObject` - {@link WorkletRuntime} - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/ - */ -// @ts-expect-error Public API overload. -export function createWorkletRuntime( - config?: WorkletRuntimeConfig -): WorkletRuntime; - -/** - * @deprecated Please use the new config object signature instead: - * `createWorkletRuntime({ name, initializer })` - * - * Lets you create a new JS runtime which can be used to run worklets possibly - * on different threads than JS or UI thread. - * @param name - A name used to identify the runtime which will appear in - * devices list in Chrome DevTools. - * @param initializer - An optional worklet that will be run synchronously on - * the same thread immediately after the runtime is created. - * @returns WorkletRuntime which is a - * `jsi::HostObject` - {@link WorkletRuntime} - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/ - */ -export function createWorkletRuntime( - name?: string, - initializer?: () => void -): WorkletRuntime; - -export function createWorkletRuntime( - nameOrConfig?: string | WorkletRuntimeConfigInternal, - initializer?: WorkletFunction<[], void> -): WorkletRuntime { - const runtimeBoundCapturableConsole = getMemorySafeCapturableConsole(); - - let name: string; - let initializerFn: (() => void) | undefined; - let useDefaultQueue = true; - let customQueue: object | undefined; - let animationQueuePollingRate: number; - let enableEventLoop = true; - if (typeof nameOrConfig === 'string') { - name = nameOrConfig; - initializerFn = initializer; - } else { - // TODO: Make anonymous name globally unique. - name = nameOrConfig?.name ?? 'anonymous'; - initializerFn = nameOrConfig?.initializer; - useDefaultQueue = nameOrConfig?.useDefaultQueue ?? true; - customQueue = nameOrConfig?.customQueue; - animationQueuePollingRate = Math.round( - nameOrConfig?.animationQueuePollingRate ?? 16 - ); - enableEventLoop = nameOrConfig?.enableEventLoop ?? true; - } - - if (initializerFn && !isWorkletFunction(initializerFn)) { - throw new WorkletsError( - 'The initializer passed to `createWorkletRuntime` is not a worklet.' - ); - } - - return WorkletsModule.createWorkletRuntime( - name, - createSerializable(() => { - 'worklet'; - setupCallGuard(); - registerWorkletsError(); - setupConsole(runtimeBoundCapturableConsole); - if (enableEventLoop) { - setupRunLoop(animationQueuePollingRate); - } - initializerFn?.(); - }), - useDefaultQueue, - customQueue, - enableEventLoop - ); -} - -/** - * Lets you asynchronously run a - * [worklet](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#worklet) - * on a [Worker - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime). - * - * Check - * {@link https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds} - * for more information about the different runtime kinds. - * - * - The worklet is scheduled on the Worker Runtime's [Async - * Queue](https://github.com/software-mansion/react-native-reanimated/blob/main/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h) - * - The function cannot be scheduled on the Worker Runtime from [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime) - * or another [Worker - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime), - * unless the [Bundle - * Mode](https://docs.swmansion.com/react-native-worklets/docs/experimental/bundleMode) - * is enabled. - * - * @param workletRuntime - The runtime to schedule the worklet on. - * @param worklet - The worklet to schedule. - * @param args - The arguments to pass to the worklet. - * @returns The return value of the worklet. - */ -// @ts-expect-error This overload is correct since it's what user sees in their code -// before it's transformed by Worklets Babel plugin. -export function scheduleOnRuntime( - workletRuntime: WorkletRuntime, - worklet: (...args: Args) => ReturnValue, - ...args: Args -): void; - -export function scheduleOnRuntime( - workletRuntime: WorkletRuntime, - worklet: WorkletFunction, - ...args: Args -): void { - 'worklet'; - if (__DEV__ && !isWorkletFunction(worklet)) { - throw new WorkletsError( - 'The function passed to `scheduleOnRuntime` is not a worklet.' - ); - } - if (globalThis.__RUNTIME_KIND !== RuntimeKind.ReactNative) { - globalThis._scheduleOnRuntime( - workletRuntime, - makeShareableCloneOnUIRecursive(() => { - 'worklet'; - worklet(...args); - }) - ); - } - - WorkletsModule.scheduleOnRuntime( - workletRuntime, - createSerializable(() => { - 'worklet'; - worklet(...args); - globalThis.__flushMicrotasks(); - }) - ); -} - -/** - * @deprecated Use `scheduleOnRuntime` instead. - * - * Schedule a worklet to execute on the background queue. - */ -// @ts-expect-error This overload is correct since it's what user sees in their code -// before it's transformed by Worklets Babel plugin. -export function runOnRuntime( - workletRuntime: WorkletRuntime, - worklet: (...args: Args) => ReturnValue -): WorkletFunction; - -export function runOnRuntime( - workletRuntime: WorkletRuntime, - worklet: WorkletFunction -): (...args: Args) => void { - 'worklet'; - if (__DEV__ && !isWorkletFunction(worklet)) { - throw new WorkletsError( - 'The function passed to `runOnRuntime` is not a worklet.' - ); - } - return (...args) => scheduleOnRuntime(workletRuntime, worklet, ...args); -} - -type WorkletRuntimeConfigInternal = WorkletRuntimeConfig & { - initializer?: WorkletFunction<[], void>; -}; diff --git a/frontend-admin/node_modules/react-native-worklets/src/runtimes.ts b/frontend-admin/node_modules/react-native-worklets/src/runtimes.ts index 428b5e07..2e5a85dc 100644 --- a/frontend-admin/node_modules/react-native-worklets/src/runtimes.ts +++ b/frontend-admin/node_modules/react-native-worklets/src/runtimes.ts @@ -1,40 +1,193 @@ 'use strict'; -import { WorkletsError } from './debug/WorkletsError'; -import type { - WorkletFunction, - WorkletRuntime, - WorkletRuntimeConfig, -} from './types'; +import { setupCallGuard } from './callGuard'; +import { getMemorySafeCapturableConsole, setupConsole } from './initializers'; +import { SHOULD_BE_USE_WEB } from './PlatformChecker'; +import { setupRunLoop } from './runLoop/workletRuntime'; +import { RuntimeKind } from './runtimeKind'; +import { + createSerializable, + makeShareableCloneOnUIRecursive, +} from './serializable'; +import { isWorkletFunction } from './workletFunction'; +import { registerWorkletsError, WorkletsError } from './WorkletsError'; +import { WorkletsModule } from './WorkletsModule'; +import type { WorkletFunction, WorkletRuntime } from './workletTypes'; +/** + * Lets you create a new JS runtime which can be used to run worklets possibly + * on different threads than JS or UI thread. + * + * @param config - Runtime configuration object - {@link WorkletRuntimeConfig}. + * @returns WorkletRuntime which is a + * `jsi::HostObject` - {@link WorkletRuntime} + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/ + */ +// @ts-expect-error Public API overload. export function createWorkletRuntime( config?: WorkletRuntimeConfig ): WorkletRuntime; +/** + * @deprecated Please use the new config object signature instead: + * `createWorkletRuntime({ name, initializer })` + * + * Lets you create a new JS runtime which can be used to run worklets possibly + * on different threads than JS or UI thread. + * @param name - A name used to identify the runtime which will appear in + * devices list in Chrome DevTools. + * @param initializer - An optional worklet that will be run synchronously on + * the same thread immediately after the runtime is created. + * @returns WorkletRuntime which is a + * `jsi::HostObject` - {@link WorkletRuntime} + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/ + */ export function createWorkletRuntime( name?: string, initializer?: () => void ): WorkletRuntime; -export function createWorkletRuntime(): never { - throw new WorkletsError('`createWorkletRuntime` is not supported on web.'); +export function createWorkletRuntime( + nameOrConfig?: string | WorkletRuntimeConfigInternal, + initializer?: WorkletFunction<[], void> +): WorkletRuntime { + const runtimeBoundCapturableConsole = getMemorySafeCapturableConsole(); + + let name: string; + let initializerFn: (() => void) | undefined; + let useDefaultQueue = true; + let customQueue: object | undefined; + let animationQueuePollingRate: number; + let enableEventLoop = true; + if (typeof nameOrConfig === 'string') { + name = nameOrConfig; + initializerFn = initializer; + } else { + // TODO: Make anonymous name globally unique. + name = nameOrConfig?.name ?? 'anonymous'; + initializerFn = nameOrConfig?.initializer; + useDefaultQueue = nameOrConfig?.useDefaultQueue ?? true; + customQueue = nameOrConfig?.customQueue; + animationQueuePollingRate = Math.round( + nameOrConfig?.animationQueuePollingRate ?? 16 + ); + enableEventLoop = nameOrConfig?.enableEventLoop ?? true; + } + + if (initializerFn && !isWorkletFunction(initializerFn)) { + throw new WorkletsError( + 'The initializer passed to `createWorkletRuntime` is not a worklet.' + ); + } + + return WorkletsModule.createWorkletRuntime( + name, + createSerializable(() => { + 'worklet'; + setupCallGuard(); + registerWorkletsError(); + setupConsole(runtimeBoundCapturableConsole); + if (enableEventLoop) { + setupRunLoop(animationQueuePollingRate); + } + initializerFn?.(); + }), + useDefaultQueue, + customQueue, + enableEventLoop + ); } +// @ts-expect-error Check `runOnUI` overload. export function runOnRuntime( workletRuntime: WorkletRuntime, worklet: (...args: Args) => ReturnValue ): WorkletFunction; - -export function runOnRuntime(): never { - throw new WorkletsError('`runOnRuntime` is not supported on web.'); -} - -export function scheduleOnRuntime( +/** Schedule a worklet to execute on the background queue. */ +export function runOnRuntime( workletRuntime: WorkletRuntime, - worklet: (...args: Args) => ReturnValue, - ...args: Args -): void; - -export function scheduleOnRuntime(): never { - throw new WorkletsError('`scheduleOnRuntime` is not supported on web.'); + worklet: WorkletFunction +): (...args: Args) => void { + 'worklet'; + if (__DEV__ && !SHOULD_BE_USE_WEB && !isWorkletFunction(worklet)) { + throw new WorkletsError( + 'The function passed to `runOnRuntime` is not a worklet.' + ); + } + if (globalThis.__RUNTIME_KIND !== RuntimeKind.ReactNative) { + return (...args) => + globalThis._scheduleOnRuntime( + workletRuntime, + makeShareableCloneOnUIRecursive(() => { + 'worklet'; + worklet(...args); + }) + ); + } + return (...args) => + WorkletsModule.scheduleOnRuntime( + workletRuntime, + createSerializable(() => { + 'worklet'; + worklet(...args); + globalThis.__flushMicrotasks(); + }) + ); } + +/** Configuration object for creating a worklet runtime. */ +export type WorkletRuntimeConfig = { + /** The name of the worklet runtime. */ + name?: string; + /** + * A worklet that will be run immediately after the runtime is created and + * before any other worklets. + */ + initializer?: () => void; + /** + * Time interval in milliseconds between polling of frame callbacks scheduled + * by requestAnimationFrame. If not specified, it defaults to 16 ms. + */ + animationQueuePollingRate?: number; + /** + * Determines whether to enable the default Event Loop or not. The Event Loop + * provides implementations for `setTimeout`, `setImmediate`, `setInterval`, + * `requestAnimationFrame`, `queueMicrotask`, `clearTimeout`, `clearInterval`, + * `clearImmediate`, and `cancelAnimationFrame` methods. If not specified, it + * defaults to `true`. + */ + enableEventLoop?: true; +} & ( + | { + /** + * If true, the runtime will use the default queue implementation for + * scheduling worklets. Defaults to true. + */ + useDefaultQueue?: true; + /** + * An optional custom queue to be used for scheduling worklets. + * + * The queue has to implement the C++ `AsyncQueue` interface from + * ``. + */ + customQueue?: never; + } + | { + /** + * If true, the runtime will use the default queue implementation for + * scheduling worklets. Defaults to true. + */ + useDefaultQueue: false; + /** + * An optional custom queue to be used for scheduling worklets. + * + * The queue has to implement the C++ `AsyncQueue` interface from + * ``. + */ + customQueue?: object; + } +); + +type WorkletRuntimeConfigInternal = WorkletRuntimeConfig & { + initializer?: WorkletFunction<[], void>; +}; diff --git a/frontend-admin/node_modules/react-native-worklets/src/specs/NativeWorkletsModule.ts b/frontend-admin/node_modules/react-native-worklets/src/specs/NativeWorkletsModule.ts index 4a5d6ad7..1ef93b02 100644 --- a/frontend-admin/node_modules/react-native-worklets/src/specs/NativeWorkletsModule.ts +++ b/frontend-admin/node_modules/react-native-worklets/src/specs/NativeWorkletsModule.ts @@ -1,6 +1,6 @@ 'use strict'; - -import { type TurboModule, TurboModuleRegistry } from 'react-native'; +import type { TurboModule } from 'react-native'; +import { TurboModuleRegistry } from 'react-native'; export interface Spec extends TurboModule { installTurboModule: () => boolean; diff --git a/frontend-admin/node_modules/react-native-worklets/src/specs/index.ts b/frontend-admin/node_modules/react-native-worklets/src/specs/index.ts index 61d4b31a..f9a36f0b 100644 --- a/frontend-admin/node_modules/react-native-worklets/src/specs/index.ts +++ b/frontend-admin/node_modules/react-native-worklets/src/specs/index.ts @@ -4,7 +4,7 @@ import { RuntimeKind } from '../runtimeKind'; import type { Spec } from './NativeWorkletsModule'; import RNWorkletsTurboModule from './NativeWorkletsModule'; -export const WorkletsTurboModule: Spec | null | undefined = +export const WorkletsTurboModule: Spec | null = globalThis.__RUNTIME_KIND === RuntimeKind.ReactNative ? RNWorkletsTurboModule : // In Bundle Mode, on Worklet Runtimes `RNWorkletsTurboModule` isn't diff --git a/frontend-admin/node_modules/react-native-worklets/src/threads.native.ts b/frontend-admin/node_modules/react-native-worklets/src/threads.native.ts deleted file mode 100644 index 5e59a65f..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/threads.native.ts +++ /dev/null @@ -1,423 +0,0 @@ -'use strict'; - -import { WorkletsError } from './debug/WorkletsError'; -import { - createSerializable, - makeShareableCloneOnUIRecursive, -} from './memory/serializable'; -import { serializableMappingCache } from './memory/serializableMappingCache'; -import { RuntimeKind } from './runtimeKind'; -import type { WorkletFunction, WorkletImport } from './types'; -import { isWorkletFunction } from './workletFunction'; -import { WorkletsModule } from './WorkletsModule/NativeWorklets'; - -type UIJob = [ - worklet: WorkletFunction, - args: Args, - resolve?: (value: ReturnValue) => void, -]; - -let runOnUIQueue: UIJob[] = []; - -export function setupMicrotasks() { - 'worklet'; - - let microtasksQueue: Array<() => void> = []; - let isExecutingMicrotasksQueue = false; - globalThis.queueMicrotask = (callback: () => void) => { - microtasksQueue.push(callback); - }; - globalThis._microtaskQueueFinalizers = []; - - globalThis.__callMicrotasks = () => { - if (isExecutingMicrotasksQueue) { - return; - } - try { - isExecutingMicrotasksQueue = true; - for (let index = 0; index < microtasksQueue.length; index += 1) { - // we use classic 'for' loop because the size of the currentTasks array may change while executing some of the callbacks due to queueMicrotask calls - microtasksQueue[index](); - } - microtasksQueue = []; - globalThis._microtaskQueueFinalizers.forEach((finalizer) => finalizer()); - } finally { - isExecutingMicrotasksQueue = false; - } - }; -} - -function callMicrotasksOnUIThread() { - 'worklet'; - globalThis.__callMicrotasks(); -} - -export const callMicrotasks = callMicrotasksOnUIThread; - -/** - * Lets you schedule a function to be executed on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * - * - The callback executes asynchronously and doesn't return a value. - * - Passed function and args are automatically - * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) - * and serialized. - * - This function cannot be called from the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime) - * or a [Worker - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime), - * unless you have the [Bundle Mode](/docs/experimental/bundleMode) enabled. - * - * @param fun - A reference to a function you want to schedule on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * @param args - Arguments to pass to the function. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnUI - */ -// @ts-expect-error This overload is correct since it's what user sees in their code -// before it's transformed by Worklets Babel plugin. -export function scheduleOnUI( - worklet: (...args: Args) => ReturnValue, - ...args: Args -): void; - -export function scheduleOnUI( - worklet: WorkletFunction, - ...args: Args -): void { - if ( - __DEV__ && - !isWorkletFunction(worklet) && - !(worklet as unknown as WorkletImport).__bundleData - ) { - throw new WorkletsError('`scheduleOnUI` can only be used with worklets.'); - } - if (__DEV__) { - // in DEV mode we call serializable conversion here because in case the object - // can't be converted, we will get a meaningful stack-trace as opposed to the - // situation when conversion is only done via microtask queue. This does not - // make the app particularily less efficient as converted objects are cached - // and for a given worklet the conversion only happens once. - createSerializable(worklet); - createSerializable(args); - } - - enqueueUI(worklet, args); -} - -/** - * Lets you asynchronously run - * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) - * functions on the [UI - * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/). - * - * This method does not schedule the work immediately but instead waits for - * other worklets to be scheduled within the same JS loop. It uses - * queueMicrotask to schedule all the worklets at once making sure they will run - * within the same frame boundaries on the UI thread. - * - * @param fun - A reference to a function you want to execute on the [UI - * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/) - * from the [JavaScript - * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/). - * @returns A function that accepts arguments for the function passed as the - * first argument. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI @deprecated Use `scheduleOnUI` instead. - */ -// @ts-expect-error This overload is correct since it's what user sees in their code -// before it's transformed by Worklets Babel plugin. -export function runOnUI( - worklet: (...args: Args) => ReturnValue -): (...args: Args) => void; - -export function runOnUI( - worklet: WorkletFunction -): (...args: Args) => void { - if ( - __DEV__ && - !isWorkletFunction(worklet) && - !(worklet as unknown as WorkletImport).__bundleData - ) { - throw new WorkletsError('`runOnUI` can only be used with worklets.'); - } - return (...args: Args) => { - scheduleOnUI(worklet, ...args); - }; -} - -if (__DEV__) { - function runOnUIWorklet(): void { - 'worklet'; - throw new WorkletsError( - '`runOnUI` cannot be called on the UI runtime. Please call the function synchronously or use `queueMicrotask` or `requestAnimationFrame` instead.' - ); - } - - const serializableRunOnUIWorklet = createSerializable(runOnUIWorklet); - serializableMappingCache.set(runOnUI, serializableRunOnUIWorklet); -} - -/** - * Lets you run a function synchronously on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime) - * from the [RN - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#rn-runtime). - * Passed function and args are automatically - * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) - * and serialized. - * - * - This function cannot be called from the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * - This function cannot be called from a [Worker - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime). - * - * @param fun - A reference to a function you want to execute on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * @param args - Arguments to pass to the function. - * @returns The return value of the function passed as the first argument. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUISync - */ -// @ts-expect-error This overload is correct since it's what user sees in their code -// before it's transformed by Worklets Babel plugin. -export function runOnUISync( - worklet: (...args: Args) => ReturnValue, - ...args: Args -): ReturnValue; - -export function runOnUISync( - worklet: WorkletFunction, - ...args: Args -): ReturnValue { - return WorkletsModule.executeOnUIRuntimeSync( - createSerializable(() => { - 'worklet'; - const result = worklet(...args); - return makeShareableCloneOnUIRecursive(result); - }) - ); -} - -// @ts-expect-error This overload is correct since it's what user sees in their code -// before it's transformed by Worklets Babel plugin. -export function executeOnUIRuntimeSync( - worklet: (...args: Args) => ReturnValue -): (...args: Args) => ReturnValue; - -export function executeOnUIRuntimeSync( - worklet: WorkletFunction -): (...args: Args) => ReturnValue { - return (...args) => { - return runOnUISync(worklet, ...args); - }; -} - -type ReleaseRemoteFunction = { - (...args: Args): ReturnValue; -}; - -type DevRemoteFunction = { - __remoteFunction: (...args: Args) => ReturnValue; -}; - -type RemoteFunction = - | ReleaseRemoteFunction - | DevRemoteFunction; - -function runWorkletOnJS( - worklet: WorkletFunction, - ...args: Args -): void { - // remote function that calls a worklet synchronously on the JS runtime - worklet(...args); -} - -/** - * Lets you schedule a function to be executed on the RN runtime from any - * runtime. Check - * {@link https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds} - * for more information about the different runtime kinds. - * - * Scheduling function from the RN Runtime (we are already on RN Runtime) simply - * uses `queueMicrotask`. - * - * When functions need to be scheduled from the UI Runtime, first function and - * args are serialized and then the system passes the scheduling responsibility - * to the JSScheduler. The JSScheduler then uses the RN CallInvoker to schedule - * the function asynchronously on the JavaScript thread by calling - * `jsCallInvoker_->invokeAsync()`. - * - * When called from a Worker Runtime, it uses the same JSScheduler mechanism. - * - * @param fun - A function you want to schedule on the RN runtime. A function - * can be a worklet, a remote function or a regular function. - * @param args - Arguments to pass to the function. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnRN - */ -export function scheduleOnRN( - fun: - | ((...args: Args) => ReturnValue) - | RemoteFunction - | WorkletFunction, - ...args: Args -): void { - 'worklet'; - type FunDevRemote = Extract>; - if (globalThis.__RUNTIME_KIND === RuntimeKind.ReactNative) { - // if we are already on the JS thread, we just schedule the worklet on the JS queue - queueMicrotask( - args.length - ? () => (fun as (...args: Args) => ReturnValue)(...args) - : (fun as () => ReturnValue) - ); - return; - } - if (isWorkletFunction(fun)) { - // If `fun` is a worklet, we schedule a call of a remote function `runWorkletOnJS` - // and pass the worklet as a first argument followed by original arguments. - scheduleOnRN(runWorkletOnJS, fun, ...args); - return; - } - if ((fun as FunDevRemote).__remoteFunction) { - // In development mode the function provided as `fun` throws an error message - // such that when someone accidentally calls it directly on the UI runtime, they - // see that they should use `runOnJS` instead. To facilitate that we put the - // reference to the original remote function in the `__remoteFunction` property. - fun = (fun as FunDevRemote).__remoteFunction; - } - - const scheduleOnRNImpl = - typeof fun === 'function' - ? globalThis._scheduleHostFunctionOnJS - : globalThis._scheduleRemoteFunctionOnJS; - - scheduleOnRNImpl( - fun as (...args: Args) => ReturnValue, - args.length > 0 ? makeShareableCloneOnUIRecursive(args) : undefined - ); -} - -/** - * Lets you asynchronously run - * non-[workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) - * functions that couldn't otherwise run on the [UI - * thread](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-thread). - * This applies to most external libraries as they don't have their functions - * marked with "worklet"; directive. - * - * @param fun - A reference to a function you want to execute on the JavaScript - * thread from the UI thread. - * @returns A function that accepts arguments for the function passed as the - * first argument. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnJS - */ -/** @deprecated Use `scheduleOnRN` instead. */ -export function runOnJS( - fun: - | ((...args: Args) => ReturnValue) - | RemoteFunction - | WorkletFunction -): (...args: Args) => void { - 'worklet'; - return (...args: Args) => { - scheduleOnRN(fun, ...args); - }; -} - -/** - * Lets you asynchronously run - * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) - * functions on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * - * This method does not schedule the work immediately but instead waits for - * other worklets to be scheduled within the same JS loop. It uses - * queueMicrotask to schedule all the worklets at once making sure they will run - * within the same frame boundaries on the UI thread. - * - * @param fun - A reference to a function you want to execute on the [UI - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime). - * from the [JavaScript - * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#javascript-runtime). - * @returns A promise that resolves to the return value of the function passed - * as the first argument. - * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUIAsync - */ -export function runOnUIAsync( - worklet: (...args: Args) => ReturnValue, - ...args: Args -): Promise { - if (__DEV__ && !isWorkletFunction(worklet)) { - throw new WorkletsError('`runOnUIAsync` can only be used with worklets.'); - } - return new Promise((resolve) => { - if (__DEV__) { - // in DEV mode we call serializable conversion here because in case the object - // can't be converted, we will get a meaningful stack-trace as opposed to the - // situation when conversion is only done via microtask queue. This does not - // make the app particularily less efficient as converted objects are cached - // and for a given worklet the conversion only happens once. - createSerializable(worklet); - createSerializable(args); - } - - enqueueUI(worklet as WorkletFunction, args, resolve); - }); -} - -if (__DEV__) { - function runOnUIAsyncWorklet(): void { - 'worklet'; - throw new WorkletsError( - '`runOnUIAsync` cannot be called on the UI runtime. Please call the function synchronously or use `queueMicrotask` or `requestAnimationFrame` instead.' - ); - } - - const serializableRunOnUIAsyncWorklet = - createSerializable(runOnUIAsyncWorklet); - serializableMappingCache.set(runOnUIAsync, serializableRunOnUIAsyncWorklet); -} - -function enqueueUI( - worklet: WorkletFunction, - args: Args, - resolve?: (value: ReturnValue) => void -): void { - const job = [worklet, args, resolve] as UIJob; - runOnUIQueue.push(job as unknown as UIJob); - if (runOnUIQueue.length === 1) { - flushUIQueue(); - } -} - -function flushUIQueue(): void { - queueMicrotask(() => { - const queue = runOnUIQueue; - runOnUIQueue = []; - WorkletsModule.scheduleOnUI( - createSerializable(() => { - 'worklet'; - queue.forEach(([workletFunction, workletArgs, jobResolve]) => { - const result = workletFunction(...workletArgs); - if (jobResolve) { - runOnJS(jobResolve)(result); - } - }); - callMicrotasks(); - }) - ); - }); -} - -/** - * Added temporarily for integration with `react-native-audio-api`. Don't depend - * on this API as it may change without notice. - */ -// eslint-disable-next-line camelcase -export function unstable_eventLoopTask( - worklet: (...args: TArgs) => TRet -) { - return (...args: TArgs) => { - 'worklet'; - worklet(...args); - callMicrotasks(); - }; -} diff --git a/frontend-admin/node_modules/react-native-worklets/src/threads.ts b/frontend-admin/node_modules/react-native-worklets/src/threads.ts index 3d3a908c..854a5494 100644 --- a/frontend-admin/node_modules/react-native-worklets/src/threads.ts +++ b/frontend-admin/node_modules/react-native-worklets/src/threads.ts @@ -1,80 +1,412 @@ 'use strict'; - -import { WorkletsError } from './debug/WorkletsError'; -import { mockedRequestAnimationFrame } from './runLoop/uiRuntime/mockedRequestAnimationFrame'; - -export function callMicrotasks(): void { - // on web flushing is a noop as immediates are handled by the browser -} - -export function scheduleOnUI( - worklet: (...args: Args) => ReturnValue, - ...args: Args -): void { - enqueueUI(worklet, args); -} - -export function runOnUI( - worklet: (...args: Args) => ReturnValue -): (...args: Args) => void { - return (...args) => { - scheduleOnUI(worklet, ...args); - }; -} - -export function runOnUISync( - worklet: (...args: Args) => ReturnValue, - ...args: Args -): ReturnValue; - -export function runOnUISync(): never { - throw new WorkletsError('`runOnUISync` is not supported on web.'); -} - -export function executeOnUIRuntimeSync( - worklet: (...args: Args) => ReturnValue -): (...args: Args) => ReturnValue; - -export function executeOnUIRuntimeSync(): never { - throw new WorkletsError('`executeOnUIRuntimeSync` is not supported on web.'); -} - -export function runOnJS( - fun: (...args: Args) => ReturnValue -): (...args: Args) => void { - return (...args) => scheduleOnRN(fun, ...args); -} - -export function scheduleOnRN( - fun: (...args: Args) => ReturnValue, - ...args: Args -): void { - queueMicrotask( - args.length - ? () => (fun as (...args: Args) => ReturnValue)(...args) - : (fun as () => ReturnValue) - ); -} - -export function runOnUIAsync( - worklet: (...args: Args) => ReturnValue, - ...args: Args -): Promise { - return new Promise((resolve) => { - enqueueUI(worklet, args, resolve); - }); -} +import { IS_JEST, SHOULD_BE_USE_WEB } from './PlatformChecker'; +import { RuntimeKind } from './runtimeKind'; +import { + createSerializable, + makeShareableCloneOnUIRecursive, +} from './serializable'; +import { serializableMappingCache } from './serializableMappingCache'; +import { isWorkletFunction } from './workletFunction'; +import { WorkletsError } from './WorkletsError'; +import { WorkletsModule } from './WorkletsModule'; +import type { WorkletFunction, WorkletImport } from './workletTypes'; type UIJob = [ - worklet: (...args: Args) => ReturnValue, + worklet: WorkletFunction, args: Args, resolve?: (value: ReturnValue) => void, ]; let runOnUIQueue: UIJob[] = []; -function enqueueUI( +export function setupMicrotasks() { + 'worklet'; + + let microtasksQueue: Array<() => void> = []; + let isExecutingMicrotasksQueue = false; + global.queueMicrotask = (callback: () => void) => { + microtasksQueue.push(callback); + }; + global._microtaskQueueFinalizers = []; + + global.__callMicrotasks = () => { + if (isExecutingMicrotasksQueue) { + return; + } + try { + isExecutingMicrotasksQueue = true; + for (let index = 0; index < microtasksQueue.length; index += 1) { + // we use classic 'for' loop because the size of the currentTasks array may change while executing some of the callbacks due to queueMicrotask calls + microtasksQueue[index](); + } + microtasksQueue = []; + global._microtaskQueueFinalizers.forEach((finalizer) => finalizer()); + } finally { + isExecutingMicrotasksQueue = false; + } + }; +} + +function callMicrotasksOnUIThread() { + 'worklet'; + global.__callMicrotasks(); +} + +export const callMicrotasks = SHOULD_BE_USE_WEB + ? () => { + // on web flushing is a noop as immediates are handled by the browser + } + : callMicrotasksOnUIThread; + +/** + * Lets you schedule a function to be executed on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * + * - The callback executes asynchronously and doesn't return a value. + * - Passed function and args are automatically + * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) + * and serialized. + * - This function cannot be called from the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime) + * or [Worker + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#worker-worklet-runtime---worker-runtime), + * unless you have the [Bundle Mode](/docs/experimental/bundleMode) enabled. + * + * @param fun - A reference to a function you want to schedule on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * @param args - Arguments to pass to the function. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnUI + */ +export function scheduleOnUI( worklet: (...args: Args) => ReturnValue, + ...args: Args +): void { + runOnUI(worklet)(...args); +} + +/** + * Lets you asynchronously run + * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) + * functions on the [UI + * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/). + * + * This method does not schedule the work immediately but instead waits for + * other worklets to be scheduled within the same JS loop. It uses + * queueMicrotask to schedule all the worklets at once making sure they will run + * within the same frame boundaries on the UI thread. + * + * @param fun - A reference to a function you want to execute on the [UI + * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/) + * from the [JavaScript + * thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/). + * @returns A function that accepts arguments for the function passed as the + * first argument. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI @deprecated Use `scheduleOnUI` instead. + */ +// @ts-expect-error This overload is correct since it's what user sees in his code +// before it's transformed by Reanimated Babel plugin. +export function runOnUI( + worklet: (...args: Args) => ReturnValue +): (...args: Args) => void; + +export function runOnUI( + worklet: WorkletFunction +): (...args: Args) => void { + if ( + __DEV__ && + !SHOULD_BE_USE_WEB && + !isWorkletFunction(worklet) && + !(worklet as unknown as WorkletImport).__bundleData + ) { + throw new WorkletsError('`runOnUI` can only be used with worklets.'); + } + return (...args) => { + if (IS_JEST) { + // Mocking time in Jest is tricky as both requestAnimationFrame and queueMicrotask + // callbacks run on the same queue and can be interleaved. There is no way + // to flush particular queue in Jest and the only control over mocked timers + // is by using jest.advanceTimersByTime() method which advances all types + // of timers including immediate and animation callbacks. Ideally we'd like + // to have some way here to schedule work along with React updates, but + // that's not possible, and hence in Jest environment instead of using scheduling + // mechanism we just schedule the work ommiting the queue. This is ok for the + // uses that we currently have but may not be ok for future tests that we write. + WorkletsModule.scheduleOnUI( + createSerializable(() => { + 'worklet'; + worklet(...args); + }) + ); + return; + } + if (__DEV__) { + // in DEV mode we call serializable conversion here because in case the object + // can't be converted, we will get a meaningful stack-trace as opposed to the + // situation when conversion is only done via microtask queue. This does not + // make the app particularily less efficient as converted objects are cached + // and for a given worklet the conversion only happens once. + createSerializable(worklet); + createSerializable(args); + } + + enqueueUI(worklet, args); + }; +} + +if (__DEV__) { + function runOnUIWorklet(): void { + 'worklet'; + throw new WorkletsError( + '`runOnUI` cannot be called on the UI runtime. Please call the function synchronously or use `queueMicrotask` or `requestAnimationFrame` instead.' + ); + } + + const serializableRunOnUIWorklet = createSerializable(runOnUIWorklet); + serializableMappingCache.set(runOnUI, serializableRunOnUIWorklet); +} + +/** + * Lets you run a function synchronously on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime) + * from the [RN + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#react-native-runtime-rn-runtime). + * Passed function and args are automatically + * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) + * and serialized. + * + * - This function cannot be called from the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * - This function cannot be called from a [Worker + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#worker-worklet-runtime---worker-runtime). + * + * @param fun - A reference to a function you want to execute on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * @param args - Arguments to pass to the function. + * @returns The return value of the function passed as the first argument. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUISync + */ +export function runOnUISync( + worklet: (...args: Args) => ReturnValue, + ...args: Args +): ReturnValue { + return executeOnUIRuntimeSync(worklet)(...args); +} + +// @ts-expect-error Check `executeOnUIRuntimeSync` overload above. +export function executeOnUIRuntimeSync( + worklet: (...args: Args) => ReturnValue +): (...args: Args) => ReturnValue; + +export function executeOnUIRuntimeSync( + worklet: WorkletFunction +): (...args: Args) => ReturnValue { + return (...args) => { + return WorkletsModule.executeOnUIRuntimeSync( + createSerializable(() => { + 'worklet'; + const result = worklet(...args); + return makeShareableCloneOnUIRecursive(result); + }) + ); + }; +} + +type ReleaseRemoteFunction = { + (...args: Args): ReturnValue; +}; + +type DevRemoteFunction = { + __remoteFunction: (...args: Args) => ReturnValue; +}; + +type RemoteFunction = + | ReleaseRemoteFunction + | DevRemoteFunction; + +function runWorkletOnJS( + worklet: WorkletFunction, + ...args: Args +): void { + // remote function that calls a worklet synchronously on the JS runtime + worklet(...args); +} + +/** + * Lets you asynchronously run + * non-[workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) + * functions that couldn't otherwise run on the [UI + * thread](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-thread). + * This applies to most external libraries as they don't have their functions + * marked with "worklet"; directive. + * + * @param fun - A reference to a function you want to execute on the JavaScript + * thread from the UI thread. + * @returns A function that accepts arguments for the function passed as the + * first argument. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnJS + */ +/** @deprecated Use `scheduleOnRN` instead. */ +export function runOnJS( + fun: + | ((...args: Args) => ReturnValue) + | RemoteFunction + | WorkletFunction +): (...args: Args) => void { + 'worklet'; + type FunDevRemote = Extract>; + if ( + SHOULD_BE_USE_WEB || + globalThis.__RUNTIME_KIND === RuntimeKind.ReactNative + ) { + // if we are already on the JS thread, we just schedule the worklet on the JS queue + return (...args) => + queueMicrotask( + args.length + ? () => (fun as (...args: Args) => ReturnValue)(...args) + : (fun as () => ReturnValue) + ); + } + if (isWorkletFunction(fun)) { + // If `fun` is a worklet, we schedule a call of a remote function `runWorkletOnJS` + // and pass the worklet as a first argument followed by original arguments. + + return (...args) => + runOnJS(runWorkletOnJS)( + fun as WorkletFunction, + ...args + ); + } + if ((fun as FunDevRemote).__remoteFunction) { + // In development mode the function provided as `fun` throws an error message + // such that when someone accidentally calls it directly on the UI runtime, they + // see that they should use `runOnJS` instead. To facilitate that we put the + // reference to the original remote function in the `__remoteFunction` property. + fun = (fun as FunDevRemote).__remoteFunction; + } + + const scheduleOnJS = + typeof fun === 'function' + ? global._scheduleHostFunctionOnJS + : global._scheduleRemoteFunctionOnJS; + + return (...args) => { + scheduleOnJS( + fun as + | ((...args: Args) => ReturnValue) + | WorkletFunction, + args.length > 0 ? makeShareableCloneOnUIRecursive(args) : undefined + ); + }; +} + +/** + * Lets you schedule a function to be executed on the RN runtime from any + * runtime. Check + * {@link https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds} + * for more information about the different runtime kinds. + * + * Scheduling function from the RN Runtime (we are already on RN Runtime) simply + * uses `queueMicrotask`. + * + * When functions need to be scheduled from the UI Runtime, first function and + * args are serialized and then the system passes the scheduling responsibility + * to the JSScheduler. The JSScheduler then uses the RN CallInvoker to schedule + * the function asynchronously on the JavaScript thread by calling + * `jsCallInvoker_->invokeAsync()`. + * + * When called from a Worker Runtime, it uses the same JSScheduler mechanism. + * + * @param fun - A function you want to schedule on the RN runtime. A function + * can be a worklet, a remote function or a regular function. + * @param args - Arguments to pass to the function. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnRN + */ +export function scheduleOnRN( + fun: + | ((...args: Args) => ReturnValue) + | RemoteFunction + | WorkletFunction, + ...args: Args +): void { + 'worklet'; + runOnJS(fun)(...args); +} + +/** + * Lets you asynchronously run + * [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize) + * functions on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * + * This method does not schedule the work immediately but instead waits for + * other worklets to be scheduled within the same JS loop. It uses + * queueMicrotask to schedule all the worklets at once making sure they will run + * within the same frame boundaries on the UI thread. + * + * @param fun - A reference to a function you want to execute on the [UI + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime). + * from the [JavaScript + * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#javascript-runtime). + * @returns A promise that resolves to the return value of the function passed + * as the first argument. + * @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUIAsync + */ +export function runOnUIAsync( + worklet: (...args: Args) => ReturnValue +): (...args: Args) => Promise { + if (__DEV__ && !SHOULD_BE_USE_WEB && !isWorkletFunction(worklet)) { + throw new WorkletsError('`runOnUIAsync` can only be used with worklets.'); + } + return (...args: Args) => { + return new Promise((resolve) => { + if (IS_JEST) { + // Mocking time in Jest is tricky as both requestAnimationFrame and queueMicrotask + // callbacks run on the same queue and can be interleaved. There is no way + // to flush particular queue in Jest and the only control over mocked timers + // is by using jest.advanceTimersByTime() method which advances all types + // of timers including immediate and animation callbacks. Ideally we'd like + // to have some way here to schedule work along with React updates, but + // that's not possible, and hence in Jest environment instead of using scheduling + // mechanism we just schedule the work ommiting the queue. This is ok for the + // uses that we currently have but may not be ok for future tests that we write. + WorkletsModule.scheduleOnUI( + createSerializable(() => { + 'worklet'; + worklet(...args); + }) + ); + return; + } + if (__DEV__) { + // in DEV mode we call serializable conversion here because in case the object + // can't be converted, we will get a meaningful stack-trace as opposed to the + // situation when conversion is only done via microtask queue. This does not + // make the app particularily less efficient as converted objects are cached + // and for a given worklet the conversion only happens once. + createSerializable(worklet); + createSerializable(args); + } + + enqueueUI(worklet as WorkletFunction, args, resolve); + }); + }; +} + +if (__DEV__) { + function runOnUIAsyncWorklet(): void { + 'worklet'; + throw new WorkletsError( + '`runOnUIAsync` cannot be called on the UI runtime. Please call the function synchronously or use `queueMicrotask` or `requestAnimationFrame` instead.' + ); + } + + const serializableRunOnUIAsyncWorklet = + createSerializable(runOnUIAsyncWorklet); + serializableMappingCache.set(runOnUIAsync, serializableRunOnUIAsyncWorklet); +} + +function enqueueUI( + worklet: WorkletFunction, args: Args, resolve?: (value: ReturnValue) => void ): void { @@ -89,22 +421,32 @@ function flushUIQueue(): void { queueMicrotask(() => { const queue = runOnUIQueue; runOnUIQueue = []; - requestAnimationFrameImpl(() => { - queue.forEach(([workletFunction, workletArgs, jobResolve]) => { - const result = workletFunction(...workletArgs); - if (jobResolve) { - jobResolve(result); - } - }); - }); + WorkletsModule.scheduleOnUI( + createSerializable(() => { + 'worklet'; + queue.forEach(([workletFunction, workletArgs, jobResolve]) => { + const result = workletFunction(...workletArgs); + if (jobResolve) { + runOnJS(jobResolve)(result); + } + }); + callMicrotasks(); + }) + ); }); } +/** + * Added temporarily for integration with `react-native-audio-api`. Don't depend + * on this API as it may change without notice. + */ // eslint-disable-next-line camelcase -export function unstable_eventLoopTask(): never { - throw new WorkletsError('`unstable_eventLoopTask` is not supported on web.'); +export function unstable_eventLoopTask( + worklet: (...args: TArgs) => TRet +) { + return (...args: TArgs) => { + 'worklet'; + worklet(...args); + callMicrotasks(); + }; } - -const requestAnimationFrameImpl = !globalThis.requestAnimationFrame - ? mockedRequestAnimationFrame - : globalThis.requestAnimationFrame; diff --git a/frontend-admin/node_modules/react-native-worklets/src/types.ts b/frontend-admin/node_modules/react-native-worklets/src/types.ts deleted file mode 100644 index 8a3f4859..00000000 --- a/frontend-admin/node_modules/react-native-worklets/src/types.ts +++ /dev/null @@ -1,151 +0,0 @@ -/* eslint-disable reanimated/use-global-this */ -'use strict'; - -import type { RuntimeKind } from './runtimeKind'; - -/** Public globals to be exposed to the user. */ -declare global { - /** - * @deprecated Use {@link __RUNTIME_KIND} instead. - * - * This global variable is a diagnostic/development tool. - * - * It's `true` on Worklet Runtimes and `false` on React Native Runtime. - */ - var _WORKLET: boolean | undefined; - - /** - * This ArrayBuffer contains the memory address of `jsi::Runtime` which is the - * Reanimated UI runtime. - */ - var _WORKLET_RUNTIME: ArrayBuffer; - - /** @deprecated Don't use. */ - var _IS_FABRIC: boolean | undefined; - - /** - * This global variable is used to determine the kind of the current runtime. - * You can use it directly to differentiate between runtimes. However, the - * recommended way for differentiating is to use the {@link getRuntimeKind} - * function. - * - * - Value _1_: React Native Runtime - * - Value _2_: UI Worklet Runtime - * - Value _3_: Worker Worklet Runtime - */ - var __RUNTIME_KIND: RuntimeKind | 1 | 2 | 3; -} - -export type WorkletRuntime = { - __hostObjectWorkletRuntime: never; - readonly name: string; -}; - -export type WorkletStackDetails = [ - error: Error, - lineOffset: number, - columnOffset: number, -]; - -export type WorkletClosure = Record; - -interface WorkletInitData { - code: string; - /** Only in dev builds. */ - location?: string; - /** Only in dev builds. */ - sourceMap?: string; -} - -interface WorkletProps { - __closure: WorkletClosure; - __workletHash: number; - /** Only in Legacy Bundling. */ - __initData?: WorkletInitData; - /** Only for Handles. */ - __init?: () => unknown; - /** `__stackDetails` is removed after parsing. */ - __stackDetails?: WorkletStackDetails; - /** Only in dev builds. */ - __pluginVersion?: string; -} - -export type WorkletFunction< - TArgs extends unknown[] = unknown[], - TReturn = unknown, -> = ((...args: TArgs) => TReturn) & WorkletProps; - -export interface WorkletFactory< - TArgs extends unknown[] = unknown[], - TReturn = unknown, - TClosureVariables extends Record = Record, -> { - (closureVariables: TClosureVariables): WorkletFunction; -} - -export type ValueUnpacker = WorkletFunction< - [objectToUnpack: unknown, category?: string], - unknown ->; - -export interface WorkletImport { - __bundleData: { - /** Name of the module which is the source of the import. */ - source: string; - /** The name of the imported value. */ - imported: string; - }; -} - -/** Configuration object for creating a worklet runtime. */ -export type WorkletRuntimeConfig = { - /** The name of the worklet runtime. */ - name?: string; - /** - * A worklet that will be run immediately after the runtime is created and - * before any other worklets. - */ - initializer?: () => void; - /** - * Time interval in milliseconds between polling of frame callbacks scheduled - * by requestAnimationFrame. If not specified, it defaults to 16 ms. - */ - animationQueuePollingRate?: number; - /** - * Determines whether to enable the default Event Loop or not. The Event Loop - * provides implementations for `setTimeout`, `setImmediate`, `setInterval`, - * `requestAnimationFrame`, `queueMicrotask`, `clearTimeout`, `clearInterval`, - * `clearImmediate`, and `cancelAnimationFrame` methods. If not specified, it - * defaults to `true`. - */ - enableEventLoop?: true; -} & ( - | { - /** - * If true, the runtime will use the default queue implementation for - * scheduling worklets. Defaults to true. - */ - useDefaultQueue?: true; - /** - * An optional custom queue to be used for scheduling worklets. - * - * The queue has to implement the C++ `AsyncQueue` interface from - * ``. - */ - customQueue?: never; - } - | { - /** - * If true, the runtime will use the default queue implementation for - * scheduling worklets. Defaults to true. - */ - useDefaultQueue: false; - /** - * An optional custom queue to be used for scheduling worklets. - * - * The queue has to implement the C++ `AsyncQueue` interface from - * ``. - */ - customQueue?: object; - } -); diff --git a/frontend-admin/node_modules/react-native-worklets/src/workletFunction.ts b/frontend-admin/node_modules/react-native-worklets/src/workletFunction.ts index e258144f..9e95fe16 100644 --- a/frontend-admin/node_modules/react-native-worklets/src/workletFunction.ts +++ b/frontend-admin/node_modules/react-native-worklets/src/workletFunction.ts @@ -1,11 +1,12 @@ 'use strict'; -import type { WorkletFunction } from './types'; +import type { WorkletFunction } from './workletTypes'; /** * This function allows you to determine if a given function is a worklet. It - * only works with Worklets Babel plugin enabled. Unless you are doing something - * with internals of Worklets you shouldn't need to use this function. + * only works with Reanimated Babel plugin enabled. Unless you are doing + * something with internals of Reanimated you shouldn't need to use this + * function. * * ### Note * diff --git a/frontend-admin/node_modules/tar/dist/commonjs/unpack.d.ts b/frontend-admin/node_modules/tar/dist/commonjs/unpack.d.ts index 5242d81f..924bdad4 100644 --- a/frontend-admin/node_modules/tar/dist/commonjs/unpack.d.ts +++ b/frontend-admin/node_modules/tar/dist/commonjs/unpack.d.ts @@ -5,6 +5,7 @@ import { TarOptions } from './options.js'; import { PathReservations } from './path-reservations.js'; import { ReadEntry } from './read-entry.js'; import { WarnData } from './warn-method.js'; +import { SymlinkError } from './symlink-error.js'; declare const ONENTRY: unique symbol; declare const CHECKFS: unique symbol; declare const CHECKFS2: unique symbol; @@ -15,6 +16,7 @@ declare const DIRECTORY: unique symbol; declare const LINK: unique symbol; declare const SYMLINK: unique symbol; declare const HARDLINK: unique symbol; +declare const ENSURE_NO_SYMLINK: unique symbol; declare const UNSUPPORTED: unique symbol; declare const CHECKPATH: unique symbol; declare const STRIPABSOLUTEPATH: unique symbol; @@ -75,6 +77,7 @@ export declare class Unpack extends Parser { [UNSUPPORTED](entry: ReadEntry): void; [SYMLINK](entry: ReadEntry, done: () => void): void; [HARDLINK](entry: ReadEntry, done: () => void): void; + [ENSURE_NO_SYMLINK](entry: ReadEntry, cwd: string, parts: string[], done: () => void, onError: (er: SymlinkError) => void): void; [PEND](): void; [UNPEND](): void; [SKIP](entry: ReadEntry): void; @@ -91,6 +94,7 @@ export declare class UnpackSync extends Unpack { [FILE](entry: ReadEntry, done: () => void): void; [DIRECTORY](entry: ReadEntry, done: () => void): void; [MKDIR](dir: string, mode: number): unknown; + [ENSURE_NO_SYMLINK](_entry: ReadEntry, cwd: string, parts: string[], done: () => void, onError: (er: SymlinkError) => void): void; [LINK](entry: ReadEntry, linkpath: string, link: 'link' | 'symlink', done: () => void): void; } export {}; diff --git a/frontend-admin/node_modules/tar/dist/commonjs/unpack.d.ts.map b/frontend-admin/node_modules/tar/dist/commonjs/unpack.d.ts.map index 448a4dc8..a16d1168 100644 --- a/frontend-admin/node_modules/tar/dist/commonjs/unpack.d.ts.map +++ b/frontend-admin/node_modules/tar/dist/commonjs/unpack.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"unpack.d.ts","sourceRoot":"","sources":["../../src/unpack.ts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AE,CAAC,EAAE,CAAC,EAAE,KAAK,KAAK,IAAI;IAwG5D,CAAC,MAAM,CAAC,CACN,EAAE,EAAE,IAAI,GAAG,SAAS,GAAG,KAAK,EAC5B,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,MAAM,IAAI;IA0BlB,CAAC,IAAI,CAAC,CACJ,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,MAAM,IAAI;CAYnB;AAYD,qBAAa,UAAW,SAAQ,MAAM;IACpC,IAAI,EAAE,IAAI,CAAQ;IAElB,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,IAAI,GAAG,KAAK,GAAG,SAAS,EAAE,KAAK,EAAE,SAAS;IAIvD,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,SAAS;IAqE1B,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,IAAI;IAyFzC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,IAAI;IAkC9C,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAkBjC,CAAC,iBAAiB,CAAC,CACjB,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,MAAM,IAAI,EAChB,OAAO,EAAE,CAAC,EAAE,EAAE,YAAY,KAAK,IAAI;IAiBrC,CAAC,IAAI,CAAC,CACJ,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,MAAM,IAAI;CAWnB"} \ No newline at end of file diff --git a/frontend-admin/node_modules/tar/dist/commonjs/unpack.js b/frontend-admin/node_modules/tar/dist/commonjs/unpack.js index 73ad5f9b..dce46531 100644 --- a/frontend-admin/node_modules/tar/dist/commonjs/unpack.js +++ b/frontend-admin/node_modules/tar/dist/commonjs/unpack.js @@ -54,6 +54,8 @@ const parse_js_1 = require("./parse.js"); const strip_absolute_path_js_1 = require("./strip-absolute-path.js"); const wc = __importStar(require("./winchars.js")); const path_reservations_js_1 = require("./path-reservations.js"); +const symlink_error_js_1 = require("./symlink-error.js"); +const process_umask_js_1 = require("./process-umask.js"); const ONENTRY = Symbol('onEntry'); const CHECKFS = Symbol('checkFs'); const CHECKFS2 = Symbol('checkFs2'); @@ -64,6 +66,7 @@ const DIRECTORY = Symbol('directory'); const LINK = Symbol('link'); const SYMLINK = Symbol('symlink'); const HARDLINK = Symbol('hardlink'); +const ENSURE_NO_SYMLINK = Symbol('ensureNoSymlink'); const UNSUPPORTED = Symbol('unsupported'); const CHECKPATH = Symbol('checkPath'); const STRIPABSOLUTEPATH = Symbol('stripAbsolutePath'); @@ -226,7 +229,7 @@ class Unpack extends parse_js_1.Parser { this.processUmask = !this.chmod ? 0 : typeof opt.processUmask === 'number' ? opt.processUmask - : process.umask(); + : (0, process_umask_js_1.umask)(); this.umask = typeof opt.umask === 'number' ? opt.umask : this.processUmask; // default mode for dirs created as parents @@ -301,6 +304,7 @@ class Unpack extends parse_js_1.Parser { } return true; } + // no IO, just string checking for absolute indicators [CHECKPATH](entry) { const p = (0, normalize_windows_path_js_1.normalizeWindowsPath)(entry.path); const parts = p.split('/'); @@ -561,11 +565,33 @@ class Unpack extends parse_js_1.Parser { entry.resume(); } [SYMLINK](entry, done) { - this[LINK](entry, String(entry.linkpath), 'symlink', done); + const parts = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.relative(this.cwd, node_path_1.default.resolve(node_path_1.default.dirname(String(entry.absolute)), String(entry.linkpath)))).split('/'); + this[ENSURE_NO_SYMLINK](entry, this.cwd, parts, () => this[LINK](entry, String(entry.linkpath), 'symlink', done), er => { + this[ONERROR](er, entry); + done(); + }); } [HARDLINK](entry, done) { const linkpath = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.resolve(this.cwd, String(entry.linkpath))); - this[LINK](entry, linkpath, 'link', done); + const parts = (0, normalize_windows_path_js_1.normalizeWindowsPath)(String(entry.linkpath)).split('/'); + this[ENSURE_NO_SYMLINK](entry, this.cwd, parts, () => this[LINK](entry, linkpath, 'link', done), er => { + this[ONERROR](er, entry); + done(); + }); + } + [ENSURE_NO_SYMLINK](entry, cwd, parts, done, onError) { + const p = parts.shift(); + if (this.preservePaths || p === undefined) + return done(); + const t = node_path_1.default.resolve(cwd, p); + node_fs_1.default.lstat(t, (er, st) => { + if (er) + return done(); + if (st?.isSymbolicLink()) { + return onError(new symlink_error_js_1.SymlinkError(t, node_path_1.default.resolve(t, parts.join('/')))); + } + this[ENSURE_NO_SYMLINK](entry, t, parts, done, onError); + }); } [PEND]() { this[PENDING]++; @@ -699,7 +725,6 @@ class Unpack extends parse_js_1.Parser { } } [LINK](entry, linkpath, link, done) { - // XXX: get the type ('symlink' or 'junction') for windows node_fs_1.default[link](linkpath, String(entry.absolute), er => { if (er) { this[ONERROR](er, entry); @@ -901,10 +926,25 @@ class UnpackSync extends Unpack { return er; } } + [ENSURE_NO_SYMLINK](_entry, cwd, parts, done, onError) { + if (this.preservePaths || !parts.length) + return done(); + let t = cwd; + for (const p of parts) { + t = node_path_1.default.resolve(t, p); + const [er, st] = callSync(() => node_fs_1.default.lstatSync(t)); + if (er) + return done(); + if (st.isSymbolicLink()) { + return onError(new symlink_error_js_1.SymlinkError(t, node_path_1.default.resolve(cwd, parts.join('/')))); + } + } + done(); + } [LINK](entry, linkpath, link, done) { - const ls = `${link}Sync`; + const linkSync = `${link}Sync`; try { - node_fs_1.default[ls](linkpath, String(entry.absolute)); + node_fs_1.default[linkSync](linkpath, String(entry.absolute)); done(); entry.resume(); } diff --git a/frontend-admin/node_modules/tar/dist/commonjs/unpack.js.map b/frontend-admin/node_modules/tar/dist/commonjs/unpack.js.map index 5251da3c..f2ded835 100644 --- a/frontend-admin/node_modules/tar/dist/commonjs/unpack.js.map +++ b/frontend-admin/node_modules/tar/dist/commonjs/unpack.js.map @@ -1 +1 @@ -{"version":3,"file":"unpack.js","sourceRoot":"","sources":["../../src/unpack.ts"],"names":[],"mappings":";AAAA,0EAA0E;AAC1E,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;AACxE,8DAA8D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9D,yDAA0C;AAC1C,8DAAgC;AAChC,6CAAyC;AACzC,sDAAwC;AACxC,0DAA4B;AAC5B,2DAAkD;AAClD,yCAAyD;AACzD,2EAAkE;AAClE,yCAAmC;AACnC,qEAA4D;AAC5D,kDAAmC;AAGnC,iEAAyD;AAIzD,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AACjC,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AACjC,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;AACnC,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;AACvC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAC/B,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;AAC3B,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;AACrC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;AAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AACjC,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;AACnC,MAAM,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;AACzC,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;AACrC,MAAM,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAA;AACrD,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;AAC7B,MAAM,O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close yet.\n// but the path reservations are required to avoid race conditions where\n// parallelized unpack ops may mess with one another, due to dependencies\n// (like a Link depending on its target) or destructive operations (like\n// clobbering an fs object to create one of a different type.)\n\nimport * as fsm from '@isaacs/fs-minipass'\nimport assert from 'node:assert'\nimport { randomBytes } from 'node:crypto'\nimport fs, { type Stats } from 'node:fs'\nimport path from 'node:path'\nimport { getWriteFlag } from './get-write-flag.js'\nimport { mkdir, MkdirError, mkdirSync } from './mkdir.js'\nimport { normalizeWindowsPath } from './normalize-windows-path.js'\nimport { Parser } from './parse.js'\nimport { stripAbsolutePath } from './strip-absolute-path.js'\nimport * as wc from './winchars.js'\n\nimport { TarOptions } from './options.js'\nimport { PathReservations } from './path-reservations.js'\nimport { ReadEntry } from './read-entry.js'\nimport { WarnData } from './warn-method.js'\n\nconst ONENTRY = Symbol('onEntry')\nconst CHECKFS = Symbol('checkFs')\nconst CHECKFS2 = Symbol('checkFs2')\nconst ISREUSABLE = Symbol('isReusable')\nconst MAKEFS = Symbol('makeFs')\nconst FILE = Symbol('file')\nconst DIRECTORY = Symbol('directory')\nconst LINK = Symbol('link')\nconst SYMLINK = Symbol('symlink')\nconst HARDLINK = Symbol('hardlink')\nconst UNSUPPORTED = Symbol('unsupported')\nconst CHECKPATH = Symbol('checkPath')\nconst STRIPABSOLUTEPATH = Symbol('stripAbsolutePath')\nconst MKDIR = Symbol('mkdir')\nconst ONERROR = Symbol('onError')\nconst PENDING = Symbol('pending')\nconst PEND = Symbol('pend')\nconst UNPEND = Symbol('unpend')\nconst ENDED = Symbol('ended')\nconst MAYBECLOSE = Symbol('maybeClose')\nconst SKIP = Symbol('skip')\nconst DOCHOWN = Symbol('doChown')\nconst UID = Symbol('uid')\nconst GID = Symbol('gid')\nconst CHECKED_CWD = Symbol('checkedCwd')\nconst platform =\n process.env.TESTING_TAR_FAKE_PLATFORM || process.platform\nconst isWindows = platform === 'win32'\nconst DEFAULT_MAX_DEPTH = 1024\n\n// Unlinks on Windows are not atomic.\n//\n// This means that if you have a file entry, followed by another\n// file entry with an identical name, and you cannot re-use the file\n// (because it's a hardlink, or because unlink:true is set, or it's\n// Windows, which does not have useful nlink values), then the unlink\n// will be committed to the disk AFTER the new file has been written\n// over the old one, deleting the new file.\n//\n// To work around this, on Windows systems, we rename the file and then\n// delete the renamed file. It's a sloppy kludge, but frankly, I do not\n// know of a better way to do this, given windows' non-atomic unlink\n// semantics.\n//\n// See: https://github.com/npm/node-tar/issues/183\n/* c8 ignore start */\nconst unlinkFile = (\n path: string,\n cb: (er?: Error | null) => void,\n) => {\n if (!isWindows) {\n return fs.unlink(path, cb)\n }\n\n const name = path + '.DELETE.' + randomBytes(16).toString('hex')\n fs.rename(path, name, er => {\n if (er) {\n return cb(er)\n }\n fs.unlink(name, cb)\n })\n}\n/* c8 ignore stop */\n\n/* c8 ignore start */\nconst unlinkFileSync = (path: string) => {\n if (!isWindows) {\n return fs.unlinkSync(path)\n }\n\n const name = path + '.DELETE.' + randomBytes(16).toString('hex')\n fs.renameSync(path, name)\n fs.unlinkSync(name)\n}\n/* c8 ignore stop */\n\n// this.gid, entry.gid, this.processUid\nconst uint32 = (\n a: number | undefined,\n b: number | undefined,\n c: number | undefined,\n) =>\n a !== undefined && a === a >>> 0 ? a\n : b !== undefined && b === b >>> 0 ? b\n : c\n\nexport class Unpack extends Parser {\n [ENDED]: boolean = false;\n [CHECKED_CWD]: boolean = false;\n [PENDING]: number = 0\n\n reservations: PathReservations = new PathReservations()\n transform?: TarOptions['transform']\n writable: true = true\n readable: false = false\n uid?: number\n gid?: number\n setOwner: boolean\n preserveOwner: boolean\n processGid?: number\n processUid?: number\n maxDepth: number\n forceChown: boolean\n win32: boolean\n newer: boolean\n keep: boolean\n noMtime: boolean\n preservePaths: boolean\n unlink: boolean\n cwd: string\n strip: number\n processUmask: number\n umask: number\n dmode: number\n fmode: number\n chmod: boolean\n\n constructor(opt: TarOptions = {}) {\n opt.ondone = () => {\n this[ENDED] = true\n this[MAYBECLOSE]()\n }\n\n super(opt)\n\n this.transform = opt.transform\n\n this.chmod = !!opt.chmod\n\n if (typeof opt.uid === 'number' || typeof opt.gid === 'number') {\n // need both or neither\n if (\n typeof opt.uid !== 'number' ||\n typeof opt.gid !== 'number'\n ) {\n throw new TypeError(\n 'cannot set owner without number uid and gid',\n )\n }\n if (opt.preserveOwner) {\n throw new TypeError(\n 'cannot preserve owner in archive and also set owner explicitly',\n )\n }\n this.uid = opt.uid\n this.gid = opt.gid\n this.setOwner = true\n } else {\n this.uid = undefined\n this.gid = undefined\n this.setOwner = false\n }\n\n // default true for root\n if (\n opt.preserveOwner === undefined &&\n typeof opt.uid !== 'number'\n ) {\n this.preserveOwner = !!(\n process.getuid && process.getuid() === 0\n )\n } else {\n this.preserveOwner = !!opt.preserveOwner\n }\n\n this.processUid =\n (this.preserveOwner || this.setOwner) && process.getuid ?\n process.getuid()\n : undefined\n this.processGid =\n (this.preserveOwner || this.setOwner) && process.getgid ?\n process.getgid()\n : undefined\n\n // prevent excessively deep nesting of subfolders\n // set to `Infinity` to remove this restriction\n this.maxDepth =\n typeof opt.maxDepth === 'number' ?\n opt.maxDepth\n : DEFAULT_MAX_DEPTH\n\n // mostly just for testing, but useful in some cases.\n // Forcibly trigger a chown on every entry, no matter what\n this.forceChown = opt.forceChown === true\n\n // turn > this[ONENTRY](entry))\n }\n\n // a bad or damaged archive is a warning for Parser, but an error\n // when extracting. Mark those errors as unrecoverable, because\n // the Unpack contract cannot be met.\n warn(code: string, msg: string | Error, data: WarnData = {}) {\n if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT') {\n data.recoverable = false\n }\n return super.warn(code, msg, data)\n }\n\n [MAYBECLOSE]() {\n if (this[ENDED] && this[PENDING] === 0) {\n this.emit('prefinish')\n this.emit('finish')\n this.emit('end')\n }\n }\n\n // return false if we need to skip this file\n // return true if the field was successfully sanitized\n [STRIPABSOLUTEPATH](\n entry: ReadEntry,\n field: 'path' | 'linkpath',\n ): boolean {\n const p = entry[field]\n const { type } = entry\n if (!p || this.preservePaths) return true\n\n const parts = p.split('/')\n\n if (\n parts.includes('..') ||\n /* c8 ignore next */\n (isWindows && /^[a-z]:\\.\\.$/i.test(parts[0] ?? ''))\n ) {\n // For linkpath, check if the resolved path escapes cwd rather than\n // just rejecting any path with '..' - relative symlinks like\n // '../sibling/file' are valid if they resolve within the cwd.\n // For paths, they just simply may not ever use .. at all.\n if (field === 'path' || type === 'Link') {\n this.warn('TAR_ENTRY_ERROR', `${field} contains '..'`, {\n entry,\n [field]: p,\n })\n // not ok!\n return false\n } else {\n // Resolve linkpath relative to the entry's directory.\n // `path.posix` is safe to use because we're operating on\n // tar paths, not a filesystem.\n const entryDir = path.posix.dirname(entry.path)\n const resolved = path.posix.normalize(\n path.posix.join(entryDir, p),\n )\n // If the resolved path escapes (starts with ..), reject it\n if (resolved.startsWith('../') || resolved === '..') {\n this.warn(\n 'TAR_ENTRY_ERROR',\n `${field} escapes extraction directory`,\n {\n entry,\n [field]: p,\n },\n )\n return false\n }\n }\n }\n\n // strip off the root\n const [root, stripped] = stripAbsolutePath(p)\n if (root) {\n // ok, but triggers warning about stripping root\n entry[field] = String(stripped)\n this.warn(\n 'TAR_ENTRY_INFO',\n `stripping ${root} from absolute ${field}`,\n {\n entry,\n [field]: p,\n },\n )\n }\n return true\n }\n\n [CHECKPATH](entry: ReadEntry) {\n const p = normalizeWindowsPath(entry.path)\n const parts = p.split('/')\n\n if (this.strip) {\n if (parts.length < this.strip) {\n return false\n }\n if (entry.type === 'Link') {\n const linkparts = normalizeWindowsPath(\n String(entry.linkpath),\n ).split('/')\n if (linkparts.length >= this.strip) {\n entry.linkpath = linkparts.slice(this.strip).join('/')\n } else {\n return false\n }\n }\n parts.splice(0, this.strip)\n entry.path = parts.join('/')\n }\n\n if (isFinite(this.maxDepth) && parts.length > this.maxDepth) {\n this.warn('TAR_ENTRY_ERROR', 'path excessively deep', {\n entry,\n path: p,\n depth: parts.length,\n maxDepth: this.maxDepth,\n })\n return false\n }\n\n if (\n !this[STRIPABSOLUTEPATH](entry, 'path') ||\n !this[STRIPABSOLUTEPATH](entry, 'linkpath')\n ) {\n return false\n }\n\n if (path.isAbsolute(entry.path)) {\n entry.absolute = normalizeWindowsPath(path.resolve(entry.path))\n } else {\n entry.absolute = normalizeWindowsPath(\n path.resolve(this.cwd, entry.path),\n )\n }\n\n // if we somehow ended up with a path that escapes the cwd, and we are\n // not in preservePaths mode, then something is fishy! This should have\n // been prevented above, so ignore this for coverage.\n /* c8 ignore start - defense in depth */\n if (\n !this.preservePaths &&\n typeof entry.absolute === 'string' &&\n entry.absolute.indexOf(this.cwd + '/') !== 0 &&\n entry.absolute !== this.cwd\n ) {\n this.warn('TAR_ENTRY_ERROR', 'path escaped extraction target', {\n entry,\n path: normalizeWindowsPath(entry.path),\n resolvedPath: entry.absolute,\n cwd: this.cwd,\n })\n return false\n }\n /* c8 ignore stop */\n\n // an archive can set properties on the extraction directory, but it\n // may not replace the cwd with a different kind of thing entirely.\n if (\n entry.absolute === this.cwd &&\n entry.type !== 'Directory' &&\n entry.type !== 'GNUDumpDir'\n ) {\n return false\n }\n\n // only encode : chars that aren't drive letter indicators\n if (this.win32) {\n const { root: aRoot } = path.win32.parse(String(entry.absolute))\n entry.absolute =\n aRoot + wc.encode(String(entry.absolute).slice(aRoot.length))\n const { root: pRoot } = path.win32.parse(entry.path)\n entry.path = pRoot + wc.encode(entry.path.slice(pRoot.length))\n }\n\n return true\n }\n\n [ONENTRY](entry: ReadEntry) {\n if (!this[CHECKPATH](entry)) {\n return entry.resume()\n }\n\n assert.equal(typeof entry.absolute, 'string')\n\n switch (entry.type) {\n case 'Directory':\n case 'GNUDumpDir':\n if (entry.mode) {\n entry.mode = entry.mode | 0o700\n }\n\n // eslint-disable-next-line no-fallthrough\n case 'File':\n case 'OldFile':\n case 'ContiguousFile':\n case 'Link':\n case 'SymbolicLink':\n return this[CHECKFS](entry)\n\n case 'CharacterDevice':\n case 'BlockDevice':\n case 'FIFO':\n default:\n return this[UNSUPPORTED](entry)\n }\n }\n\n [ONERROR](er: Error, entry: ReadEntry) {\n // Cwd has to exist, or else nothing works. That's serious.\n // Other errors are warnings, which raise the error in strict\n // mode, but otherwise continue on.\n if (er.name === 'CwdError') {\n this.emit('error', er)\n } else {\n this.warn('TAR_ENTRY_ERROR', er, { entry })\n this[UNPEND]()\n entry.resume()\n }\n }\n\n [MKDIR](\n dir: string,\n mode: number,\n cb: (er?: null | MkdirError, made?: string) => void,\n ) {\n mkdir(\n normalizeWindowsPath(dir),\n {\n uid: this.uid,\n gid: this.gid,\n processUid: this.processUid,\n processGid: this.processGid,\n umask: this.processUmask,\n preserve: this.preservePaths,\n unlink: this.unlink,\n cwd: this.cwd,\n mode: mode,\n },\n cb,\n )\n }\n\n [DOCHOWN](entry: ReadEntry) {\n // in preserve owner mode, chown if the entry doesn't match process\n // in set owner mode, chown if setting doesn't match process\n return (\n this.forceChown ||\n (this.preserveOwner &&\n ((typeof entry.uid === 'number' &&\n entry.uid !== this.processUid) ||\n (typeof entry.gid === 'number' &&\n entry.gid !== this.processGid))) ||\n (typeof this.uid === 'number' &&\n this.uid !== this.processUid) ||\n (typeof this.gid === 'number' && this.gid !== this.processGid)\n )\n }\n\n [UID](entry: ReadEntry) {\n return uint32(this.uid, entry.uid, this.processUid)\n }\n\n [GID](entry: ReadEntry) {\n return uint32(this.gid, entry.gid, this.processGid)\n }\n\n [FILE](entry: ReadEntry, fullyDone: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.fmode\n const stream = new fsm.WriteStream(String(entry.absolute), {\n // slight lie, but it can be numeric flags\n flags: getWriteFlag(entry.size) as string,\n mode: mode,\n autoClose: false,\n })\n stream.on('error', (er: Error) => {\n if (stream.fd) {\n fs.close(stream.fd, () => {})\n }\n\n // flush all the data out so that we aren't left hanging\n // if the error wasn't actually fatal. otherwise the parse\n // is blocked, and we never proceed.\n stream.write = () => true\n this[ONERROR](er, entry)\n fullyDone()\n })\n\n let actions = 1\n const done = (er?: null | Error) => {\n if (er) {\n /* c8 ignore start - we should always have a fd by now */\n if (stream.fd) {\n fs.close(stream.fd, () => {})\n }\n /* c8 ignore stop */\n\n this[ONERROR](er, entry)\n fullyDone()\n return\n }\n\n if (--actions === 0) {\n if (stream.fd !== undefined) {\n fs.close(stream.fd, er => {\n if (er) {\n this[ONERROR](er, entry)\n } else {\n this[UNPEND]()\n }\n fullyDone()\n })\n }\n }\n }\n\n stream.on('finish', () => {\n // if futimes fails, try utimes\n // if utimes fails, fail with the original error\n // same for fchown/chown\n const abs = String(entry.absolute)\n const fd = stream.fd\n\n if (typeof fd === 'number' && entry.mtime && !this.noMtime) {\n actions++\n const atime = entry.atime || new Date()\n const mtime = entry.mtime\n fs.futimes(fd, atime, mtime, er =>\n er ?\n fs.utimes(abs, atime, mtime, er2 => done(er2 && er))\n : done(),\n )\n }\n\n if (typeof fd === 'number' && this[DOCHOWN](entry)) {\n actions++\n const uid = this[UID](entry)\n const gid = this[GID](entry)\n if (typeof uid === 'number' && typeof gid === 'number') {\n fs.fchown(fd, uid, gid, er =>\n er ?\n fs.chown(abs, uid, gid, er2 => done(er2 && er))\n : done(),\n )\n }\n }\n\n done()\n })\n\n const tx = this.transform ? this.transform(entry) || entry : entry\n if (tx !== entry) {\n tx.on('error', (er: Error) => {\n this[ONERROR](er, entry)\n fullyDone()\n })\n entry.pipe(tx)\n }\n tx.pipe(stream)\n }\n\n [DIRECTORY](entry: ReadEntry, fullyDone: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.dmode\n this[MKDIR](String(entry.absolute), mode, er => {\n if (er) {\n this[ONERROR](er, entry)\n fullyDone()\n return\n }\n\n let actions = 1\n const done = () => {\n if (--actions === 0) {\n fullyDone()\n this[UNPEND]()\n entry.resume()\n }\n }\n\n if (entry.mtime && !this.noMtime) {\n actions++\n fs.utimes(\n String(entry.absolute),\n entry.atime || new Date(),\n entry.mtime,\n done,\n )\n }\n\n if (this[DOCHOWN](entry)) {\n actions++\n fs.chown(\n String(entry.absolute),\n Number(this[UID](entry)),\n Number(this[GID](entry)),\n done,\n )\n }\n\n done()\n })\n }\n\n [UNSUPPORTED](entry: ReadEntry) {\n entry.unsupported = true\n this.warn(\n 'TAR_ENTRY_UNSUPPORTED',\n `unsupported entry type: ${entry.type}`,\n { entry },\n )\n entry.resume()\n }\n\n [SYMLINK](entry: ReadEntry, done: () => void) {\n this[LINK](entry, String(entry.linkpath), 'symlink', done)\n }\n\n [HARDLINK](entry: ReadEntry, done: () => void) {\n const linkpath = normalizeWindowsPath(\n path.resolve(this.cwd, String(entry.linkpath)),\n )\n this[LINK](entry, linkpath, 'link', done)\n }\n\n [PEND]() {\n this[PENDING]++\n }\n\n [UNPEND]() {\n this[PENDING]--\n this[MAYBECLOSE]()\n }\n\n [SKIP](entry: ReadEntry) {\n this[UNPEND]()\n entry.resume()\n }\n\n // Check if we can reuse an existing filesystem entry safely and\n // overwrite it, rather than unlinking and recreating\n // Windows doesn't report a useful nlink, so we just never reuse entries\n [ISREUSABLE](entry: ReadEntry, st: Stats) {\n return (\n entry.type === 'File' &&\n !this.unlink &&\n st.isFile() &&\n st.nlink <= 1 &&\n !isWindows\n )\n }\n\n // check if a thing is there, and if so, try to clobber it\n [CHECKFS](entry: ReadEntry) {\n this[PEND]()\n const paths = [entry.path]\n if (entry.linkpath) {\n paths.push(entry.linkpath)\n }\n this.reservations.reserve(paths, done =>\n this[CHECKFS2](entry, done),\n )\n }\n\n [CHECKFS2](entry: ReadEntry, fullyDone: (er?: Error) => void) {\n const done = (er?: Error) => {\n fullyDone(er)\n }\n\n const checkCwd = () => {\n this[MKDIR](this.cwd, this.dmode, er => {\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n this[CHECKED_CWD] = true\n start()\n })\n }\n\n const start = () => {\n if (entry.absolute !== this.cwd) {\n const parent = normalizeWindowsPath(\n path.dirname(String(entry.absolute)),\n )\n if (parent !== this.cwd) {\n return this[MKDIR](parent, this.dmode, er => {\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n afterMakeParent()\n })\n }\n }\n afterMakeParent()\n }\n\n const afterMakeParent = () => {\n fs.lstat(String(entry.absolute), (lstatEr, st) => {\n if (\n st &&\n (this.keep ||\n /* c8 ignore next */\n (this.newer && st.mtime > (entry.mtime ?? st.mtime)))\n ) {\n this[SKIP](entry)\n done()\n return\n }\n if (lstatEr || this[ISREUSABLE](entry, st)) {\n return this[MAKEFS](null, entry, done)\n }\n\n if (st.isDirectory()) {\n if (entry.type === 'Directory') {\n const needChmod =\n this.chmod &&\n entry.mode &&\n (st.mode & 0o7777) !== entry.mode\n const afterChmod = (er?: Error | null | undefined) =>\n this[MAKEFS](er ?? null, entry, done)\n if (!needChmod) {\n return afterChmod()\n }\n return fs.chmod(\n String(entry.absolute),\n Number(entry.mode),\n afterChmod,\n )\n }\n // Not a dir entry, have to remove it.\n // NB: the only way to end up with an entry that is the cwd\n // itself, in such a way that == does not detect, is a\n // tricky windows absolute path with UNC or 8.3 parts (and\n // preservePaths:true, or else it will have been stripped).\n // In that case, the user has opted out of path protections\n // explicitly, so if they blow away the cwd, c'est la vie.\n if (entry.absolute !== this.cwd) {\n return fs.rmdir(\n String(entry.absolute),\n (er?: null | Error) =>\n this[MAKEFS](er ?? null, entry, done),\n )\n }\n }\n\n // not a dir, and not reusable\n // don't remove if the cwd, we want that error\n if (entry.absolute === this.cwd) {\n return this[MAKEFS](null, entry, done)\n }\n\n unlinkFile(String(entry.absolute), er =>\n this[MAKEFS](er ?? null, entry, done),\n )\n })\n }\n\n if (this[CHECKED_CWD]) {\n start()\n } else {\n checkCwd()\n }\n }\n\n [MAKEFS](\n er: null | undefined | Error,\n entry: ReadEntry,\n done: () => void,\n ) {\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n\n switch (entry.type) {\n case 'File':\n case 'OldFile':\n case 'ContiguousFile':\n return this[FILE](entry, done)\n\n case 'Link':\n return this[HARDLINK](entry, done)\n\n case 'SymbolicLink':\n return this[SYMLINK](entry, done)\n\n case 'Directory':\n case 'GNUDumpDir':\n return this[DIRECTORY](entry, done)\n }\n }\n\n [LINK](\n entry: ReadEntry,\n linkpath: string,\n link: 'link' | 'symlink',\n done: () => void,\n ) {\n // XXX: get the type ('symlink' or 'junction') for windows\n fs[link](linkpath, String(entry.absolute), er => {\n if (er) {\n this[ONERROR](er, entry)\n } else {\n this[UNPEND]()\n entry.resume()\n }\n done()\n })\n }\n}\n\nconst callSync = (fn: () => any) => {\n try {\n return [null, fn()]\n } catch (er) {\n return [er, null]\n }\n}\n\nexport class UnpackSync extends Unpack {\n sync: true = true;\n\n [MAKEFS](er: null | Error | undefined, entry: ReadEntry) {\n return super[MAKEFS](er, entry, () => {})\n }\n\n [CHECKFS](entry: ReadEntry) {\n if (!this[CHECKED_CWD]) {\n const er = this[MKDIR](this.cwd, this.dmode)\n if (er) {\n return this[ONERROR](er as Error, entry)\n }\n this[CHECKED_CWD] = true\n }\n\n // don't bother to make the parent if the current entry is the cwd,\n // we've already checked it.\n if (entry.absolute !== this.cwd) {\n const parent = normalizeWindowsPath(\n path.dirname(String(entry.absolute)),\n )\n if (parent !== this.cwd) {\n const mkParent = this[MKDIR](parent, this.dmode)\n if (mkParent) {\n return this[ONERROR](mkParent as Error, entry)\n }\n }\n }\n\n const [lstatEr, st] = callSync(() =>\n fs.lstatSync(String(entry.absolute)),\n )\n if (\n st &&\n (this.keep ||\n /* c8 ignore next */\n (this.newer && st.mtime > (entry.mtime ?? st.mtime)))\n ) {\n return this[SKIP](entry)\n }\n\n if (lstatEr || this[ISREUSABLE](entry, st)) {\n return this[MAKEFS](null, entry)\n }\n\n if (st.isDirectory()) {\n if (entry.type === 'Directory') {\n const needChmod =\n this.chmod &&\n entry.mode &&\n (st.mode & 0o7777) !== entry.mode\n const [er] =\n needChmod ?\n callSync(() => {\n fs.chmodSync(String(entry.absolute), Number(entry.mode))\n })\n : []\n return this[MAKEFS](er, entry)\n }\n // not a dir entry, have to remove it\n const [er] = callSync(() =>\n fs.rmdirSync(String(entry.absolute)),\n )\n this[MAKEFS](er, entry)\n }\n\n // not a dir, and not reusable.\n // don't remove if it's the cwd, since we want that error.\n const [er] =\n entry.absolute === this.cwd ?\n []\n : callSync(() => unlinkFileSync(String(entry.absolute)))\n this[MAKEFS](er, entry)\n }\n\n [FILE](entry: ReadEntry, done: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.fmode\n\n const oner = (er?: null | Error | undefined) => {\n let closeError\n try {\n fs.closeSync(fd)\n } catch (e) {\n closeError = e\n }\n if (er || closeError) {\n this[ONERROR]((er as Error) || closeError, entry)\n }\n done()\n }\n\n let fd: number\n try {\n fd = fs.openSync(\n String(entry.absolute),\n getWriteFlag(entry.size),\n mode,\n )\n /* c8 ignore start - This is only a problem if the file was successfully\n * statted, BUT failed to open. Testing this is annoying, and we\n * already have ample testint for other uses of oner() methods.\n */\n } catch (er) {\n return oner(er as Error)\n }\n /* c8 ignore stop */\n const tx = this.transform ? this.transform(entry) || entry : entry\n if (tx !== entry) {\n tx.on('error', (er: Error) => this[ONERROR](er, entry))\n entry.pipe(tx)\n }\n\n tx.on('data', (chunk: Buffer) => {\n try {\n fs.writeSync(fd, chunk, 0, chunk.length)\n } catch (er) {\n oner(er as Error)\n }\n })\n\n tx.on('end', () => {\n let er = null\n // try both, falling futimes back to utimes\n // if either fails, handle the first error\n if (entry.mtime && !this.noMtime) {\n const atime = entry.atime || new Date()\n const mtime = entry.mtime\n try {\n fs.futimesSync(fd, atime, mtime)\n } catch (futimeser) {\n try {\n fs.utimesSync(String(entry.absolute), atime, mtime)\n } catch (utimeser) {\n er = futimeser\n }\n }\n }\n\n if (this[DOCHOWN](entry)) {\n const uid = this[UID](entry)\n const gid = this[GID](entry)\n\n try {\n fs.fchownSync(fd, Number(uid), Number(gid))\n } catch (fchowner) {\n try {\n fs.chownSync(\n String(entry.absolute),\n Number(uid),\n Number(gid),\n )\n } catch (chowner) {\n er = er || fchowner\n }\n }\n }\n\n oner(er as Error)\n })\n }\n\n [DIRECTORY](entry: ReadEntry, done: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.dmode\n const er = this[MKDIR](String(entry.absolute), mode)\n if (er) {\n this[ONERROR](er as Error, entry)\n done()\n return\n }\n if (entry.mtime && !this.noMtime) {\n try {\n fs.utimesSync(\n String(entry.absolute),\n entry.atime || new Date(),\n entry.mtime,\n )\n /* c8 ignore next */\n } catch (er) {}\n }\n if (this[DOCHOWN](entry)) {\n try {\n fs.chownSync(\n String(entry.absolute),\n Number(this[UID](entry)),\n Number(this[GID](entry)),\n )\n } catch (er) {}\n }\n done()\n entry.resume()\n }\n\n [MKDIR](dir: string, mode: number) {\n try {\n return mkdirSync(normalizeWindowsPath(dir), {\n uid: this.uid,\n gid: this.gid,\n processUid: this.processUid,\n processGid: this.processGid,\n umask: this.processUmask,\n preserve: this.preservePaths,\n unlink: this.unlink,\n cwd: this.cwd,\n mode: mode,\n })\n } catch (er) {\n return er\n }\n }\n\n [LINK](\n entry: ReadEntry,\n linkpath: string,\n link: 'link' | 'symlink',\n done: () => void,\n ) {\n const ls: `${typeof link}Sync` = `${link}Sync`\n try {\n fs[ls](linkpath, String(entry.absolute))\n done()\n entry.resume()\n } catch (er) {\n return this[ONERROR](er as Error, entry)\n }\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"unpack.js","sourceRoot":"","sources":["../../src/unpack.ts"],"names":[],"mappings":";AAAA,0EAA0E;AAC1E,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;AACxE,8DAA8D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9D,yDAA0C;AAC1C,8DAAgC;AAChC,6CAAyC;AACzC,sDAAwC;AACxC,0DAA4B;AAC5B,2DAAkD;AAClD,yCAAyD;AACzD,2EAAkE;AAClE,yCAAmC;AACnC,qEAA4D;AAC5D,kDAAmC;AAGnC,iEAAyD;AAGzD,yDAA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EAAE;gBAAE,OAAO,IAAI,EAAE,CAAA;YACrB,IAAI,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC;gBACxB,OAAO,OAAO,CACZ,IAAI,+BAAY,CAAC,CAAC,EAAE,mBAAI,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CACxD,CAAA;YACH,CAAC;QACH,CAAC;QACD,IAAI,EAAE,CAAA;IACR,CAAC;IAED,CAAC,IAAI,CAAC,CACJ,KAAgB,EAChB,QAAgB,EAChB,IAAwB,EACxB,IAAgB;QAEhB,MAAM,QAAQ,GAAyB,GAAG,IAAI,MAAM,CAAA;QACpD,IAAI,CAAC;YACH,iBAAE,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;YAC9C,IAAI,EAAE,CAAA;YACN,KAAK,CAAC,MAAM,EAAE,CAAA;QAChB,CAAC;QAAC,OAAO,EAAE,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,EAAW,EAAE,KAAK,CAAC,CAAA;QAC1C,CAAC;IACH,CAAC;CACF;AA9PD,gCA8PC","sourcesContent":["// the PEND/UNPEND stuff tracks whether we're ready to emit end/close yet.\n// but the path reservations are required to avoid race conditions where\n// parallelized unpack ops may mess with one another, due to dependencies\n// (like a Link depending on its target) or destructive operations (like\n// clobbering an fs object to create one of a different type.)\n\nimport * as fsm from '@isaacs/fs-minipass'\nimport assert from 'node:assert'\nimport { randomBytes } from 'node:crypto'\nimport fs, { type Stats } from 'node:fs'\nimport path from 'node:path'\nimport { getWriteFlag } from './get-write-flag.js'\nimport { mkdir, MkdirError, mkdirSync } from './mkdir.js'\nimport { normalizeWindowsPath } from './normalize-windows-path.js'\nimport { Parser } from './parse.js'\nimport { stripAbsolutePath } from './strip-absolute-path.js'\nimport * as wc from './winchars.js'\n\nimport { TarOptions } from './options.js'\nimport { PathReservations } from './path-reservations.js'\nimport { ReadEntry } from './read-entry.js'\nimport { WarnData } from './warn-method.js'\nimport { SymlinkError } from './symlink-error.js'\nimport { umask } from './process-umask.js'\n\nconst ONENTRY = Symbol('onEntry')\nconst CHECKFS = Symbol('checkFs')\nconst CHECKFS2 = Symbol('checkFs2')\nconst ISREUSABLE = Symbol('isReusable')\nconst MAKEFS = Symbol('makeFs')\nconst FILE = Symbol('file')\nconst DIRECTORY = Symbol('directory')\nconst LINK = Symbol('link')\nconst SYMLINK = Symbol('symlink')\nconst HARDLINK = Symbol('hardlink')\nconst ENSURE_NO_SYMLINK = Symbol('ensureNoSymlink')\nconst UNSUPPORTED = Symbol('unsupported')\nconst CHECKPATH = Symbol('checkPath')\nconst STRIPABSOLUTEPATH = Symbol('stripAbsolutePath')\nconst MKDIR = Symbol('mkdir')\nconst ONERROR = Symbol('onError')\nconst PENDING = Symbol('pending')\nconst PEND = Symbol('pend')\nconst UNPEND = Symbol('unpend')\nconst ENDED = Symbol('ended')\nconst MAYBECLOSE = Symbol('maybeClose')\nconst SKIP = Symbol('skip')\nconst DOCHOWN = Symbol('doChown')\nconst UID = Symbol('uid')\nconst GID = Symbol('gid')\nconst CHECKED_CWD = Symbol('checkedCwd')\nconst platform =\n process.env.TESTING_TAR_FAKE_PLATFORM || process.platform\nconst isWindows = platform === 'win32'\nconst DEFAULT_MAX_DEPTH = 1024\n\n// Unlinks on Windows are not atomic.\n//\n// This means that if you have a file entry, followed by another\n// file entry with an identical name, and you cannot re-use the file\n// (because it's a hardlink, or because unlink:true is set, or it's\n// Windows, which does not have useful nlink values), then the unlink\n// will be committed to the disk AFTER the new file has been written\n// over the old one, deleting the new file.\n//\n// To work around this, on Windows systems, we rename the file and then\n// delete the renamed file. It's a sloppy kludge, but frankly, I do not\n// know of a better way to do this, given windows' non-atomic unlink\n// semantics.\n//\n// See: https://github.com/npm/node-tar/issues/183\n/* c8 ignore start */\nconst unlinkFile = (\n path: string,\n cb: (er?: Error | null) => void,\n) => {\n if (!isWindows) {\n return fs.unlink(path, cb)\n }\n\n const name = path + '.DELETE.' + randomBytes(16).toString('hex')\n fs.rename(path, name, er => {\n if (er) {\n return cb(er)\n }\n fs.unlink(name, cb)\n })\n}\n/* c8 ignore stop */\n\n/* c8 ignore start */\nconst unlinkFileSync = (path: string) => {\n if (!isWindows) {\n return fs.unlinkSync(path)\n }\n\n const name = path + '.DELETE.' + randomBytes(16).toString('hex')\n fs.renameSync(path, name)\n fs.unlinkSync(name)\n}\n/* c8 ignore stop */\n\n// this.gid, entry.gid, this.processUid\nconst uint32 = (\n a: number | undefined,\n b: number | undefined,\n c: number | undefined,\n) =>\n a !== undefined && a === a >>> 0 ? a\n : b !== undefined && b === b >>> 0 ? b\n : c\n\nexport class Unpack extends Parser {\n [ENDED]: boolean = false;\n [CHECKED_CWD]: boolean = false;\n [PENDING]: number = 0\n\n reservations: PathReservations = new PathReservations()\n transform?: TarOptions['transform']\n writable: true = true\n readable: false = false\n uid?: number\n gid?: number\n setOwner: boolean\n preserveOwner: boolean\n processGid?: number\n processUid?: number\n maxDepth: number\n forceChown: boolean\n win32: boolean\n newer: boolean\n keep: boolean\n noMtime: boolean\n preservePaths: boolean\n unlink: boolean\n cwd: string\n strip: number\n processUmask: number\n umask: number\n dmode: number\n fmode: number\n chmod: boolean\n\n constructor(opt: TarOptions = {}) {\n opt.ondone = () => {\n this[ENDED] = true\n this[MAYBECLOSE]()\n }\n\n super(opt)\n\n this.transform = opt.transform\n\n this.chmod = !!opt.chmod\n\n if (typeof opt.uid === 'number' || typeof opt.gid === 'number') {\n // need both or neither\n if (\n typeof opt.uid !== 'number' ||\n typeof opt.gid !== 'number'\n ) {\n throw new TypeError(\n 'cannot set owner without number uid and gid',\n )\n }\n if (opt.preserveOwner) {\n throw new TypeError(\n 'cannot preserve owner in archive and also set owner explicitly',\n )\n }\n this.uid = opt.uid\n this.gid = opt.gid\n this.setOwner = true\n } else {\n this.uid = undefined\n this.gid = undefined\n this.setOwner = false\n }\n\n // default true for root\n if (\n opt.preserveOwner === undefined &&\n typeof opt.uid !== 'number'\n ) {\n this.preserveOwner = !!(\n process.getuid && process.getuid() === 0\n )\n } else {\n this.preserveOwner = !!opt.preserveOwner\n }\n\n this.processUid =\n (this.preserveOwner || this.setOwner) && process.getuid ?\n process.getuid()\n : undefined\n this.processGid =\n (this.preserveOwner || this.setOwner) && process.getgid ?\n process.getgid()\n : undefined\n\n // prevent excessively deep nesting of subfolders\n // set to `Infinity` to remove this restriction\n this.maxDepth =\n typeof opt.maxDepth === 'number' ?\n opt.maxDepth\n : DEFAULT_MAX_DEPTH\n\n // mostly just for testing, but useful in some cases.\n // Forcibly trigger a chown on every entry, no matter what\n this.forceChown = opt.forceChown === true\n\n // turn > this[ONENTRY](entry))\n }\n\n // a bad or damaged archive is a warning for Parser, but an error\n // when extracting. Mark those errors as unrecoverable, because\n // the Unpack contract cannot be met.\n warn(code: string, msg: string | Error, data: WarnData = {}) {\n if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT') {\n data.recoverable = false\n }\n return super.warn(code, msg, data)\n }\n\n [MAYBECLOSE]() {\n if (this[ENDED] && this[PENDING] === 0) {\n this.emit('prefinish')\n this.emit('finish')\n this.emit('end')\n }\n }\n\n // return false if we need to skip this file\n // return true if the field was successfully sanitized\n [STRIPABSOLUTEPATH](\n entry: ReadEntry,\n field: 'path' | 'linkpath',\n ): boolean {\n const p = entry[field]\n const { type } = entry\n if (!p || this.preservePaths) return true\n\n const parts = p.split('/')\n\n if (\n parts.includes('..') ||\n /* c8 ignore next */\n (isWindows && /^[a-z]:\\.\\.$/i.test(parts[0] ?? ''))\n ) {\n // For linkpath, check if the resolved path escapes cwd rather than\n // just rejecting any path with '..' - relative symlinks like\n // '../sibling/file' are valid if they resolve within the cwd.\n // For paths, they just simply may not ever use .. at all.\n if (field === 'path' || type === 'Link') {\n this.warn('TAR_ENTRY_ERROR', `${field} contains '..'`, {\n entry,\n [field]: p,\n })\n // not ok!\n return false\n } else {\n // Resolve linkpath relative to the entry's directory.\n // `path.posix` is safe to use because we're operating on\n // tar paths, not a filesystem.\n const entryDir = path.posix.dirname(entry.path)\n const resolved = path.posix.normalize(\n path.posix.join(entryDir, p),\n )\n // If the resolved path escapes (starts with ..), reject it\n if (resolved.startsWith('../') || resolved === '..') {\n this.warn(\n 'TAR_ENTRY_ERROR',\n `${field} escapes extraction directory`,\n {\n entry,\n [field]: p,\n },\n )\n return false\n }\n }\n }\n\n // strip off the root\n const [root, stripped] = stripAbsolutePath(p)\n if (root) {\n // ok, but triggers warning about stripping root\n entry[field] = String(stripped)\n this.warn(\n 'TAR_ENTRY_INFO',\n `stripping ${root} from absolute ${field}`,\n {\n entry,\n [field]: p,\n },\n )\n }\n return true\n }\n\n // no IO, just string checking for absolute indicators\n [CHECKPATH](entry: ReadEntry) {\n const p = normalizeWindowsPath(entry.path)\n const parts = p.split('/')\n\n if (this.strip) {\n if (parts.length < this.strip) {\n return false\n }\n if (entry.type === 'Link') {\n const linkparts = normalizeWindowsPath(\n String(entry.linkpath),\n ).split('/')\n if (linkparts.length >= this.strip) {\n entry.linkpath = linkparts.slice(this.strip).join('/')\n } else {\n return false\n }\n }\n parts.splice(0, this.strip)\n entry.path = parts.join('/')\n }\n\n if (isFinite(this.maxDepth) && parts.length > this.maxDepth) {\n this.warn('TAR_ENTRY_ERROR', 'path excessively deep', {\n entry,\n path: p,\n depth: parts.length,\n maxDepth: this.maxDepth,\n })\n return false\n }\n\n if (\n !this[STRIPABSOLUTEPATH](entry, 'path') ||\n !this[STRIPABSOLUTEPATH](entry, 'linkpath')\n ) {\n return false\n }\n\n if (path.isAbsolute(entry.path)) {\n entry.absolute = normalizeWindowsPath(path.resolve(entry.path))\n } else {\n entry.absolute = normalizeWindowsPath(\n path.resolve(this.cwd, entry.path),\n )\n }\n\n // if we somehow ended up with a path that escapes the cwd, and we are\n // not in preservePaths mode, then something is fishy! This should have\n // been prevented above, so ignore this for coverage.\n /* c8 ignore start - defense in depth */\n if (\n !this.preservePaths &&\n typeof entry.absolute === 'string' &&\n entry.absolute.indexOf(this.cwd + '/') !== 0 &&\n entry.absolute !== this.cwd\n ) {\n this.warn('TAR_ENTRY_ERROR', 'path escaped extraction target', {\n entry,\n path: normalizeWindowsPath(entry.path),\n resolvedPath: entry.absolute,\n cwd: this.cwd,\n })\n return false\n }\n /* c8 ignore stop */\n\n // an archive can set properties on the extraction directory, but it\n // may not replace the cwd with a different kind of thing entirely.\n if (\n entry.absolute === this.cwd &&\n entry.type !== 'Directory' &&\n entry.type !== 'GNUDumpDir'\n ) {\n return false\n }\n\n // only encode : chars that aren't drive letter indicators\n if (this.win32) {\n const { root: aRoot } = path.win32.parse(String(entry.absolute))\n entry.absolute =\n aRoot + wc.encode(String(entry.absolute).slice(aRoot.length))\n const { root: pRoot } = path.win32.parse(entry.path)\n entry.path = pRoot + wc.encode(entry.path.slice(pRoot.length))\n }\n\n return true\n }\n\n [ONENTRY](entry: ReadEntry) {\n if (!this[CHECKPATH](entry)) {\n return entry.resume()\n }\n\n assert.equal(typeof entry.absolute, 'string')\n\n switch (entry.type) {\n case 'Directory':\n case 'GNUDumpDir':\n if (entry.mode) {\n entry.mode = entry.mode | 0o700\n }\n\n // eslint-disable-next-line no-fallthrough\n case 'File':\n case 'OldFile':\n case 'ContiguousFile':\n case 'Link':\n case 'SymbolicLink':\n return this[CHECKFS](entry)\n\n case 'CharacterDevice':\n case 'BlockDevice':\n case 'FIFO':\n default:\n return this[UNSUPPORTED](entry)\n }\n }\n\n [ONERROR](er: Error, entry: ReadEntry) {\n // Cwd has to exist, or else nothing works. That's serious.\n // Other errors are warnings, which raise the error in strict\n // mode, but otherwise continue on.\n if (er.name === 'CwdError') {\n this.emit('error', er)\n } else {\n this.warn('TAR_ENTRY_ERROR', er, { entry })\n this[UNPEND]()\n entry.resume()\n }\n }\n\n [MKDIR](\n dir: string,\n mode: number,\n cb: (er?: null | MkdirError, made?: string) => void,\n ) {\n mkdir(\n normalizeWindowsPath(dir),\n {\n uid: this.uid,\n gid: this.gid,\n processUid: this.processUid,\n processGid: this.processGid,\n umask: this.processUmask,\n preserve: this.preservePaths,\n unlink: this.unlink,\n cwd: this.cwd,\n mode: mode,\n },\n cb,\n )\n }\n\n [DOCHOWN](entry: ReadEntry) {\n // in preserve owner mode, chown if the entry doesn't match process\n // in set owner mode, chown if setting doesn't match process\n return (\n this.forceChown ||\n (this.preserveOwner &&\n ((typeof entry.uid === 'number' &&\n entry.uid !== this.processUid) ||\n (typeof entry.gid === 'number' &&\n entry.gid !== this.processGid))) ||\n (typeof this.uid === 'number' &&\n this.uid !== this.processUid) ||\n (typeof this.gid === 'number' && this.gid !== this.processGid)\n )\n }\n\n [UID](entry: ReadEntry) {\n return uint32(this.uid, entry.uid, this.processUid)\n }\n\n [GID](entry: ReadEntry) {\n return uint32(this.gid, entry.gid, this.processGid)\n }\n\n [FILE](entry: ReadEntry, fullyDone: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.fmode\n const stream = new fsm.WriteStream(String(entry.absolute), {\n // slight lie, but it can be numeric flags\n flags: getWriteFlag(entry.size) as string,\n mode: mode,\n autoClose: false,\n })\n stream.on('error', (er: Error) => {\n if (stream.fd) {\n fs.close(stream.fd, () => {})\n }\n\n // flush all the data out so that we aren't left hanging\n // if the error wasn't actually fatal. otherwise the parse\n // is blocked, and we never proceed.\n stream.write = () => true\n this[ONERROR](er, entry)\n fullyDone()\n })\n\n let actions = 1\n const done = (er?: null | Error) => {\n if (er) {\n /* c8 ignore start - we should always have a fd by now */\n if (stream.fd) {\n fs.close(stream.fd, () => {})\n }\n /* c8 ignore stop */\n\n this[ONERROR](er, entry)\n fullyDone()\n return\n }\n\n if (--actions === 0) {\n if (stream.fd !== undefined) {\n fs.close(stream.fd, er => {\n if (er) {\n this[ONERROR](er, entry)\n } else {\n this[UNPEND]()\n }\n fullyDone()\n })\n }\n }\n }\n\n stream.on('finish', () => {\n // if futimes fails, try utimes\n // if utimes fails, fail with the original error\n // same for fchown/chown\n const abs = String(entry.absolute)\n const fd = stream.fd\n\n if (typeof fd === 'number' && entry.mtime && !this.noMtime) {\n actions++\n const atime = entry.atime || new Date()\n const mtime = entry.mtime\n fs.futimes(fd, atime, mtime, er =>\n er ?\n fs.utimes(abs, atime, mtime, er2 => done(er2 && er))\n : done(),\n )\n }\n\n if (typeof fd === 'number' && this[DOCHOWN](entry)) {\n actions++\n const uid = this[UID](entry)\n const gid = this[GID](entry)\n if (typeof uid === 'number' && typeof gid === 'number') {\n fs.fchown(fd, uid, gid, er =>\n er ?\n fs.chown(abs, uid, gid, er2 => done(er2 && er))\n : done(),\n )\n }\n }\n\n done()\n })\n\n const tx = this.transform ? this.transform(entry) || entry : entry\n if (tx !== entry) {\n tx.on('error', (er: Error) => {\n this[ONERROR](er, entry)\n fullyDone()\n })\n entry.pipe(tx)\n }\n tx.pipe(stream)\n }\n\n [DIRECTORY](entry: ReadEntry, fullyDone: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.dmode\n this[MKDIR](String(entry.absolute), mode, er => {\n if (er) {\n this[ONERROR](er, entry)\n fullyDone()\n return\n }\n\n let actions = 1\n const done = () => {\n if (--actions === 0) {\n fullyDone()\n this[UNPEND]()\n entry.resume()\n }\n }\n\n if (entry.mtime && !this.noMtime) {\n actions++\n fs.utimes(\n String(entry.absolute),\n entry.atime || new Date(),\n entry.mtime,\n done,\n )\n }\n\n if (this[DOCHOWN](entry)) {\n actions++\n fs.chown(\n String(entry.absolute),\n Number(this[UID](entry)),\n Number(this[GID](entry)),\n done,\n )\n }\n\n done()\n })\n }\n\n [UNSUPPORTED](entry: ReadEntry) {\n entry.unsupported = true\n this.warn(\n 'TAR_ENTRY_UNSUPPORTED',\n `unsupported entry type: ${entry.type}`,\n { entry },\n )\n entry.resume()\n }\n\n [SYMLINK](entry: ReadEntry, done: () => void) {\n const parts = normalizeWindowsPath(\n path.relative(\n this.cwd,\n path.resolve(\n path.dirname(String(entry.absolute)),\n String(entry.linkpath),\n ),\n ),\n ).split('/')\n this[ENSURE_NO_SYMLINK](\n entry,\n this.cwd,\n parts,\n () =>\n this[LINK](entry, String(entry.linkpath), 'symlink', done),\n er => {\n this[ONERROR](er, entry)\n done()\n },\n )\n }\n\n [HARDLINK](entry: ReadEntry, done: () => void) {\n const linkpath = normalizeWindowsPath(\n path.resolve(this.cwd, String(entry.linkpath)),\n )\n const parts = normalizeWindowsPath(String(entry.linkpath)).split(\n '/',\n )\n this[ENSURE_NO_SYMLINK](\n entry,\n this.cwd,\n parts,\n () => this[LINK](entry, linkpath, 'link', done),\n er => {\n this[ONERROR](er, entry)\n done()\n },\n )\n }\n\n [ENSURE_NO_SYMLINK](\n entry: ReadEntry,\n cwd: string,\n parts: string[],\n done: () => void,\n onError: (er: SymlinkError) => void,\n ) {\n const p = parts.shift()\n if (this.preservePaths || p === undefined) return done()\n const t = path.resolve(cwd, p)\n fs.lstat(t, (er, st) => {\n if (er) return done()\n if (st?.isSymbolicLink()) {\n return onError(\n new SymlinkError(t, path.resolve(t, parts.join('/'))),\n )\n }\n this[ENSURE_NO_SYMLINK](entry, t, parts, done, onError)\n })\n }\n\n [PEND]() {\n this[PENDING]++\n }\n\n [UNPEND]() {\n this[PENDING]--\n this[MAYBECLOSE]()\n }\n\n [SKIP](entry: ReadEntry) {\n this[UNPEND]()\n entry.resume()\n }\n\n // Check if we can reuse an existing filesystem entry safely and\n // overwrite it, rather than unlinking and recreating\n // Windows doesn't report a useful nlink, so we just never reuse entries\n [ISREUSABLE](entry: ReadEntry, st: Stats) {\n return (\n entry.type === 'File' &&\n !this.unlink &&\n st.isFile() &&\n st.nlink <= 1 &&\n !isWindows\n )\n }\n\n // check if a thing is there, and if so, try to clobber it\n [CHECKFS](entry: ReadEntry) {\n this[PEND]()\n const paths = [entry.path]\n if (entry.linkpath) {\n paths.push(entry.linkpath)\n }\n this.reservations.reserve(paths, done =>\n this[CHECKFS2](entry, done),\n )\n }\n\n [CHECKFS2](entry: ReadEntry, fullyDone: (er?: Error) => void) {\n const done = (er?: Error) => {\n fullyDone(er)\n }\n\n const checkCwd = () => {\n this[MKDIR](this.cwd, this.dmode, er => {\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n this[CHECKED_CWD] = true\n start()\n })\n }\n\n const start = () => {\n if (entry.absolute !== this.cwd) {\n const parent = normalizeWindowsPath(\n path.dirname(String(entry.absolute)),\n )\n if (parent !== this.cwd) {\n return this[MKDIR](parent, this.dmode, er => {\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n afterMakeParent()\n })\n }\n }\n afterMakeParent()\n }\n\n const afterMakeParent = () => {\n fs.lstat(String(entry.absolute), (lstatEr, st) => {\n if (\n st &&\n (this.keep ||\n /* c8 ignore next */\n (this.newer && st.mtime > (entry.mtime ?? st.mtime)))\n ) {\n this[SKIP](entry)\n done()\n return\n }\n if (lstatEr || this[ISREUSABLE](entry, st)) {\n return this[MAKEFS](null, entry, done)\n }\n\n if (st.isDirectory()) {\n if (entry.type === 'Directory') {\n const needChmod =\n this.chmod &&\n entry.mode &&\n (st.mode & 0o7777) !== entry.mode\n const afterChmod = (er?: Error | null | undefined) =>\n this[MAKEFS](er ?? null, entry, done)\n if (!needChmod) {\n return afterChmod()\n }\n return fs.chmod(\n String(entry.absolute),\n Number(entry.mode),\n afterChmod,\n )\n }\n // Not a dir entry, have to remove it.\n // NB: the only way to end up with an entry that is the cwd\n // itself, in such a way that == does not detect, is a\n // tricky windows absolute path with UNC or 8.3 parts (and\n // preservePaths:true, or else it will have been stripped).\n // In that case, the user has opted out of path protections\n // explicitly, so if they blow away the cwd, c'est la vie.\n if (entry.absolute !== this.cwd) {\n return fs.rmdir(\n String(entry.absolute),\n (er?: null | Error) =>\n this[MAKEFS](er ?? null, entry, done),\n )\n }\n }\n\n // not a dir, and not reusable\n // don't remove if the cwd, we want that error\n if (entry.absolute === this.cwd) {\n return this[MAKEFS](null, entry, done)\n }\n\n unlinkFile(String(entry.absolute), er =>\n this[MAKEFS](er ?? null, entry, done),\n )\n })\n }\n\n if (this[CHECKED_CWD]) {\n start()\n } else {\n checkCwd()\n }\n }\n\n [MAKEFS](\n er: null | undefined | Error,\n entry: ReadEntry,\n done: () => void,\n ) {\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n\n switch (entry.type) {\n case 'File':\n case 'OldFile':\n case 'ContiguousFile':\n return this[FILE](entry, done)\n\n case 'Link':\n return this[HARDLINK](entry, done)\n\n case 'SymbolicLink':\n return this[SYMLINK](entry, done)\n\n case 'Directory':\n case 'GNUDumpDir':\n return this[DIRECTORY](entry, done)\n }\n }\n\n [LINK](\n entry: ReadEntry,\n linkpath: string,\n link: 'link' | 'symlink',\n done: () => void,\n ) {\n fs[link](linkpath, String(entry.absolute), er => {\n if (er) {\n this[ONERROR](er, entry)\n } else {\n this[UNPEND]()\n entry.resume()\n }\n done()\n })\n }\n}\n\nconst callSync = (\n fn: () => T,\n): [null, T] | [NodeJS.ErrnoException, null] => {\n try {\n return [null, fn()]\n } catch (er) {\n return [er as NodeJS.ErrnoException, null]\n }\n}\n\nexport class UnpackSync extends Unpack {\n sync: true = true;\n\n [MAKEFS](er: null | Error | undefined, entry: ReadEntry) {\n return super[MAKEFS](er, entry, () => {})\n }\n\n [CHECKFS](entry: ReadEntry) {\n if (!this[CHECKED_CWD]) {\n const er = this[MKDIR](this.cwd, this.dmode)\n if (er) {\n return this[ONERROR](er as Error, entry)\n }\n this[CHECKED_CWD] = true\n }\n\n // don't bother to make the parent if the current entry is the cwd,\n // we've already checked it.\n if (entry.absolute !== this.cwd) {\n const parent = normalizeWindowsPath(\n path.dirname(String(entry.absolute)),\n )\n if (parent !== this.cwd) {\n const mkParent = this[MKDIR](parent, this.dmode)\n if (mkParent) {\n return this[ONERROR](mkParent as Error, entry)\n }\n }\n }\n\n const [lstatEr, st] = callSync(() =>\n fs.lstatSync(String(entry.absolute)),\n )\n if (\n st &&\n (this.keep ||\n /* c8 ignore next */\n (this.newer && st.mtime > (entry.mtime ?? st.mtime)))\n ) {\n return this[SKIP](entry)\n }\n\n if (lstatEr || this[ISREUSABLE](entry, st)) {\n return this[MAKEFS](null, entry)\n }\n\n if (st.isDirectory()) {\n if (entry.type === 'Directory') {\n const needChmod =\n this.chmod &&\n entry.mode &&\n (st.mode & 0o7777) !== entry.mode\n const [er] =\n needChmod ?\n callSync(() => {\n fs.chmodSync(String(entry.absolute), Number(entry.mode))\n })\n : []\n return this[MAKEFS](er, entry)\n }\n // not a dir entry, have to remove it\n const [er] = callSync(() =>\n fs.rmdirSync(String(entry.absolute)),\n )\n this[MAKEFS](er, entry)\n }\n\n // not a dir, and not reusable.\n // don't remove if it's the cwd, since we want that error.\n const [er] =\n entry.absolute === this.cwd ?\n []\n : callSync(() => unlinkFileSync(String(entry.absolute)))\n this[MAKEFS](er, entry)\n }\n\n [FILE](entry: ReadEntry, done: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.fmode\n\n const oner = (er?: null | Error | undefined) => {\n let closeError\n try {\n fs.closeSync(fd)\n } catch (e) {\n closeError = e\n }\n if (er || closeError) {\n this[ONERROR]((er as Error) || closeError, entry)\n }\n done()\n }\n\n let fd: number\n try {\n fd = fs.openSync(\n String(entry.absolute),\n getWriteFlag(entry.size),\n mode,\n )\n /* c8 ignore start - This is only a problem if the file was successfully\n * statted, BUT failed to open. Testing this is annoying, and we\n * already have ample testint for other uses of oner() methods.\n */\n } catch (er) {\n return oner(er as Error)\n }\n /* c8 ignore stop */\n const tx = this.transform ? this.transform(entry) || entry : entry\n if (tx !== entry) {\n tx.on('error', (er: Error) => this[ONERROR](er, entry))\n entry.pipe(tx)\n }\n\n tx.on('data', (chunk: Buffer) => {\n try {\n fs.writeSync(fd, chunk, 0, chunk.length)\n } catch (er) {\n oner(er as Error)\n }\n })\n\n tx.on('end', () => {\n let er = null\n // try both, falling futimes back to utimes\n // if either fails, handle the first error\n if (entry.mtime && !this.noMtime) {\n const atime = entry.atime || new Date()\n const mtime = entry.mtime\n try {\n fs.futimesSync(fd, atime, mtime)\n } catch (futimeser) {\n try {\n fs.utimesSync(String(entry.absolute), atime, mtime)\n } catch (utimeser) {\n er = futimeser\n }\n }\n }\n\n if (this[DOCHOWN](entry)) {\n const uid = this[UID](entry)\n const gid = this[GID](entry)\n\n try {\n fs.fchownSync(fd, Number(uid), Number(gid))\n } catch (fchowner) {\n try {\n fs.chownSync(\n String(entry.absolute),\n Number(uid),\n Number(gid),\n )\n } catch (chowner) {\n er = er || fchowner\n }\n }\n }\n\n oner(er as Error)\n })\n }\n\n [DIRECTORY](entry: ReadEntry, done: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.dmode\n const er = this[MKDIR](String(entry.absolute), mode)\n if (er) {\n this[ONERROR](er as Error, entry)\n done()\n return\n }\n if (entry.mtime && !this.noMtime) {\n try {\n fs.utimesSync(\n String(entry.absolute),\n entry.atime || new Date(),\n entry.mtime,\n )\n /* c8 ignore next */\n } catch (er) {}\n }\n if (this[DOCHOWN](entry)) {\n try {\n fs.chownSync(\n String(entry.absolute),\n Number(this[UID](entry)),\n Number(this[GID](entry)),\n )\n } catch (er) {}\n }\n done()\n entry.resume()\n }\n\n [MKDIR](dir: string, mode: number) {\n try {\n return mkdirSync(normalizeWindowsPath(dir), {\n uid: this.uid,\n gid: this.gid,\n processUid: this.processUid,\n processGid: this.processGid,\n umask: this.processUmask,\n preserve: this.preservePaths,\n unlink: this.unlink,\n cwd: this.cwd,\n mode: mode,\n })\n } catch (er) {\n return er\n }\n }\n\n [ENSURE_NO_SYMLINK](\n _entry: ReadEntry,\n cwd: string,\n parts: string[],\n done: () => void,\n onError: (er: SymlinkError) => void,\n ) {\n if (this.preservePaths || !parts.length) return done()\n let t = cwd\n for (const p of parts) {\n t = path.resolve(t, p)\n const [er, st] = callSync(() => fs.lstatSync(t))\n if (er) return done()\n if (st.isSymbolicLink()) {\n return onError(\n new SymlinkError(t, path.resolve(cwd, parts.join('/'))),\n )\n }\n }\n done()\n }\n\n [LINK](\n entry: ReadEntry,\n linkpath: string,\n link: 'link' | 'symlink',\n done: () => void,\n ) {\n const linkSync: `${typeof link}Sync` = `${link}Sync`\n try {\n fs[linkSync](linkpath, String(entry.absolute))\n done()\n entry.resume()\n } catch (er) {\n return this[ONERROR](er as Error, entry)\n }\n }\n}\n"]} \ No newline at end of file diff --git a/frontend-admin/node_modules/tar/dist/esm/unpack.d.ts b/frontend-admin/node_modules/tar/dist/esm/unpack.d.ts index 5242d81f..924bdad4 100644 --- a/frontend-admin/node_modules/tar/dist/esm/unpack.d.ts +++ b/frontend-admin/node_modules/tar/dist/esm/unpack.d.ts @@ -5,6 +5,7 @@ import { TarOptions } from './options.js'; import { PathReservations } from './path-reservations.js'; import { ReadEntry } from './read-entry.js'; import { WarnData } from './warn-method.js'; +import { SymlinkError } from './symlink-error.js'; declare const ONENTRY: unique symbol; declare const CHECKFS: unique symbol; declare const CHECKFS2: unique symbol; @@ -15,6 +16,7 @@ declare const DIRECTORY: unique symbol; declare const LINK: unique symbol; declare const SYMLINK: unique symbol; declare const HARDLINK: unique symbol; +declare const ENSURE_NO_SYMLINK: unique symbol; declare const UNSUPPORTED: unique symbol; declare const CHECKPATH: unique symbol; declare const STRIPABSOLUTEPATH: unique symbol; @@ -75,6 +77,7 @@ export declare class Unpack extends Parser { [UNSUPPORTED](entry: ReadEntry): void; [SYMLINK](entry: ReadEntry, done: () => void): void; [HARDLINK](entry: ReadEntry, done: () => void): void; + [ENSURE_NO_SYMLINK](entry: ReadEntry, cwd: string, parts: string[], done: () => void, onError: (er: SymlinkError) => void): void; [PEND](): void; [UNPEND](): void; [SKIP](entry: ReadEntry): void; @@ -91,6 +94,7 @@ export declare class UnpackSync extends Unpack { [FILE](entry: ReadEntry, done: () => void): void; [DIRECTORY](entry: ReadEntry, done: () => void): void; [MKDIR](dir: string, mode: number): unknown; + [ENSURE_NO_SYMLINK](_entry: ReadEntry, cwd: string, parts: string[], done: () => void, onError: (er: SymlinkError) => void): void; [LINK](entry: ReadEntry, linkpath: string, link: 'link' | 'symlink', done: () => void): void; } export {}; diff --git a/frontend-admin/node_modules/tar/dist/esm/unpack.d.ts.map b/frontend-admin/node_modules/tar/dist/esm/unpack.d.ts.map index 448a4dc8..a16d1168 100644 --- a/frontend-admin/node_modules/tar/dist/esm/unpack.d.ts.map +++ b/frontend-admin/node_modules/tar/dist/esm/unpack.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"unpack.d.ts","sourceRoot":"","sources":["../../src/unpack.ts"],"names":[],"mappings":"AASA,OAAW,EAAE,KAAK,KAAK,EAAE,MAAM,SAAS,CAAA;AAGxC,OAAO,EAAS,UAAU,EAAa,MAAM,YAAY,CAAA;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAInC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,QAAA,MAAM,OAAO,eAAoB,CAAA;AACjC,QAAA,MAAM,OAAO,eAAoB,CAAA;AACjC,QAAA,MAAM,QAAQ,eAAqB,CAAA;AACnC,QAAA,MAAM,UAAU,eAAuB,CAAA;AACvC,QAAA,MAAM,MAAM,eAAmB,CAAA;AAC/B,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,QAAA,MAAM,SAAS,eAAsB,CAAA;AACrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,QAAA,MAAM,OAAO,eAAoB,CAAA;AACjC,QAAA,MAAM,QAAQ,eAAqB,CAAA;AACnC,QAAA,MAAM,WAAW,eAAwB,CAAA;AACzC,QAAA,MAAM,SAAS,eAAsB,CAAA;AACrC,QAAA,MAAM,iBAAiB,eAA8B,CAAA;AACrD,QAAA,MAAM,KAA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AE,MAAM,IAAI,EAChB,OAAO,EAAE,CAAC,EAAE,EAAE,YAAY,KAAK,IAAI;IAiBrC,CAAC,IAAI,CAAC,CACJ,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,MAAM,IAAI;CAWnB"} \ No newline at end of file diff --git a/frontend-admin/node_modules/tar/dist/esm/unpack.js b/frontend-admin/node_modules/tar/dist/esm/unpack.js index 3a9aa807..1d0b53d1 100644 --- a/frontend-admin/node_modules/tar/dist/esm/unpack.js +++ b/frontend-admin/node_modules/tar/dist/esm/unpack.js @@ -15,6 +15,8 @@ import { Parser } from './parse.js'; import { stripAbsolutePath } from './strip-absolute-path.js'; import * as wc from './winchars.js'; import { PathReservations } from './path-reservations.js'; +import { SymlinkError } from './symlink-error.js'; +import { umask } from './process-umask.js'; const ONENTRY = Symbol('onEntry'); const CHECKFS = Symbol('checkFs'); const CHECKFS2 = Symbol('checkFs2'); @@ -25,6 +27,7 @@ const DIRECTORY = Symbol('directory'); const LINK = Symbol('link'); const SYMLINK = Symbol('symlink'); const HARDLINK = Symbol('hardlink'); +const ENSURE_NO_SYMLINK = Symbol('ensureNoSymlink'); const UNSUPPORTED = Symbol('unsupported'); const CHECKPATH = Symbol('checkPath'); const STRIPABSOLUTEPATH = Symbol('stripAbsolutePath'); @@ -187,7 +190,7 @@ export class Unpack extends Parser { this.processUmask = !this.chmod ? 0 : typeof opt.processUmask === 'number' ? opt.processUmask - : process.umask(); + : umask(); this.umask = typeof opt.umask === 'number' ? opt.umask : this.processUmask; // default mode for dirs created as parents @@ -262,6 +265,7 @@ export class Unpack extends Parser { } return true; } + // no IO, just string checking for absolute indicators [CHECKPATH](entry) { const p = normalizeWindowsPath(entry.path); const parts = p.split('/'); @@ -522,11 +526,33 @@ export class Unpack extends Parser { entry.resume(); } [SYMLINK](entry, done) { - this[LINK](entry, String(entry.linkpath), 'symlink', done); + const parts = normalizeWindowsPath(path.relative(this.cwd, path.resolve(path.dirname(String(entry.absolute)), String(entry.linkpath)))).split('/'); + this[ENSURE_NO_SYMLINK](entry, this.cwd, parts, () => this[LINK](entry, String(entry.linkpath), 'symlink', done), er => { + this[ONERROR](er, entry); + done(); + }); } [HARDLINK](entry, done) { const linkpath = normalizeWindowsPath(path.resolve(this.cwd, String(entry.linkpath))); - this[LINK](entry, linkpath, 'link', done); + const parts = normalizeWindowsPath(String(entry.linkpath)).split('/'); + this[ENSURE_NO_SYMLINK](entry, this.cwd, parts, () => this[LINK](entry, linkpath, 'link', done), er => { + this[ONERROR](er, entry); + done(); + }); + } + [ENSURE_NO_SYMLINK](entry, cwd, parts, done, onError) { + const p = parts.shift(); + if (this.preservePaths || p === undefined) + return done(); + const t = path.resolve(cwd, p); + fs.lstat(t, (er, st) => { + if (er) + return done(); + if (st?.isSymbolicLink()) { + return onError(new SymlinkError(t, path.resolve(t, parts.join('/')))); + } + this[ENSURE_NO_SYMLINK](entry, t, parts, done, onError); + }); } [PEND]() { this[PENDING]++; @@ -660,7 +686,6 @@ export class Unpack extends Parser { } } [LINK](entry, linkpath, link, done) { - // XXX: get the type ('symlink' or 'junction') for windows fs[link](linkpath, String(entry.absolute), er => { if (er) { this[ONERROR](er, entry); @@ -861,10 +886,25 @@ export class UnpackSync extends Unpack { return er; } } + [ENSURE_NO_SYMLINK](_entry, cwd, parts, done, onError) { + if (this.preservePaths || !parts.length) + return done(); + let t = cwd; + for (const p of parts) { + t = path.resolve(t, p); + const [er, st] = callSync(() => fs.lstatSync(t)); + if (er) + return done(); + if (st.isSymbolicLink()) { + return onError(new SymlinkError(t, path.resolve(cwd, parts.join('/')))); + } + } + done(); + } [LINK](entry, linkpath, link, done) { - const ls = `${link}Sync`; + const linkSync = `${link}Sync`; try { - fs[ls](linkpath, String(entry.absolute)); + fs[linkSync](linkpath, String(entry.absolute)); done(); entry.resume(); } diff --git a/frontend-admin/node_modules/tar/dist/esm/unpack.js.map b/frontend-admin/node_modules/tar/dist/esm/unpack.js.map index efe38c38..62505f35 100644 --- a/frontend-admin/node_modules/tar/dist/esm/unpack.js.map +++ b/frontend-admin/node_modules/tar/dist/esm/unpack.js.map @@ -1 +1 @@ -{"version":3,"file":"unpack.js","sourceRoot":"","sources":["../../src/unpack.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;AACxE,8DAA8D;AAE9D,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAkB,MAAM,SAAS,CAAA;AACxC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,KAAK,EAAc,SAAS,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AAGnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAIzD,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AACjC,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AACjC,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;AACnC,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;AACvC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAC/B,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;AAC3B,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;AACrC,MAAM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AAE,CAAA;QAChB,CAAC;QAAC,OAAO,EAAE,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,EAAW,EAAE,KAAK,CAAC,CAAA;QAC1C,CAAC;IACH,CAAC;CACF","sourcesContent":["// the PEND/UNPEND stuff tracks whether we're ready to emit end/close yet.\n// but the path reservations are required to avoid race conditions where\n// parallelized unpack ops may mess with one another, due to dependencies\n// (like a Link depending on its target) or destructive operations (like\n// clobbering an fs object to create one of a different type.)\n\nimport * as fsm from '@isaacs/fs-minipass'\nimport assert from 'node:assert'\nimport { randomBytes } from 'node:crypto'\nimport fs, { type Stats } from 'node:fs'\nimport path from 'node:path'\nimport { getWriteFlag } from './get-write-flag.js'\nimport { mkdir, MkdirError, mkdirSync } from './mkdir.js'\nimport { normalizeWindowsPath } from './normalize-windows-path.js'\nimport { Parser } from './parse.js'\nimport { stripAbsolutePath } from './strip-absolute-path.js'\nimport * as wc from './winchars.js'\n\nimport { TarOptions } from './options.js'\nimport { PathReservations } from './path-reservations.js'\nimport { ReadEntry } from './read-entry.js'\nimport { WarnData } from './warn-method.js'\n\nconst ONENTRY = Symbol('onEntry')\nconst CHECKFS = Symbol('checkFs')\nconst CHECKFS2 = Symbol('checkFs2')\nconst ISREUSABLE = Symbol('isReusable')\nconst MAKEFS = Symbol('makeFs')\nconst FILE = Symbol('file')\nconst DIRECTORY = Symbol('directory')\nconst LINK = Symbol('link')\nconst SYMLINK = Symbol('symlink')\nconst HARDLINK = Symbol('hardlink')\nconst UNSUPPORTED = Symbol('unsupported')\nconst CHECKPATH = Symbol('checkPath')\nconst STRIPABSOLUTEPATH = Symbol('stripAbsolutePath')\nconst MKDIR = Symbol('mkdir')\nconst ONERROR = Symbol('onError')\nconst PENDING = Symbol('pending')\nconst PEND = Symbol('pend')\nconst UNPEND = Symbol('unpend')\nconst ENDED = Symbol('ended')\nconst MAYBECLOSE = Symbol('maybeClose')\nconst SKIP = Symbol('skip')\nconst DOCHOWN = Symbol('doChown')\nconst UID = Symbol('uid')\nconst GID = Symbol('gid')\nconst CHECKED_CWD = Symbol('checkedCwd')\nconst platform =\n process.env.TESTING_TAR_FAKE_PLATFORM || process.platform\nconst isWindows = platform === 'win32'\nconst DEFAULT_MAX_DEPTH = 1024\n\n// Unlinks on Windows are not atomic.\n//\n// This means that if you have a file entry, followed by another\n// file entry with an identical name, and you cannot re-use the file\n// (because it's a hardlink, or because unlink:true is set, or it's\n// Windows, which does not have useful nlink values), then the unlink\n// will be committed to the disk AFTER the new file has been written\n// over the old one, deleting the new file.\n//\n// To work around this, on Windows systems, we rename the file and then\n// delete the renamed file. It's a sloppy kludge, but frankly, I do not\n// know of a better way to do this, given windows' non-atomic unlink\n// semantics.\n//\n// See: https://github.com/npm/node-tar/issues/183\n/* c8 ignore start */\nconst unlinkFile = (\n path: string,\n cb: (er?: Error | null) => void,\n) => {\n if (!isWindows) {\n return fs.unlink(path, cb)\n }\n\n const name = path + '.DELETE.' + randomBytes(16).toString('hex')\n fs.rename(path, name, er => {\n if (er) {\n return cb(er)\n }\n fs.unlink(name, cb)\n })\n}\n/* c8 ignore stop */\n\n/* c8 ignore start */\nconst unlinkFileSync = (path: string) => {\n if (!isWindows) {\n return fs.unlinkSync(path)\n }\n\n const name = path + '.DELETE.' + randomBytes(16).toString('hex')\n fs.renameSync(path, name)\n fs.unlinkSync(name)\n}\n/* c8 ignore stop */\n\n// this.gid, entry.gid, this.processUid\nconst uint32 = (\n a: number | undefined,\n b: number | undefined,\n c: number | undefined,\n) =>\n a !== undefined && a === a >>> 0 ? a\n : b !== undefined && b === b >>> 0 ? b\n : c\n\nexport class Unpack extends Parser {\n [ENDED]: boolean = false;\n [CHECKED_CWD]: boolean = false;\n [PENDING]: number = 0\n\n reservations: PathReservations = new PathReservations()\n transform?: TarOptions['transform']\n writable: true = true\n readable: false = false\n uid?: number\n gid?: number\n setOwner: boolean\n preserveOwner: boolean\n processGid?: number\n processUid?: number\n maxDepth: number\n forceChown: boolean\n win32: boolean\n newer: boolean\n keep: boolean\n noMtime: boolean\n preservePaths: boolean\n unlink: boolean\n cwd: string\n strip: number\n processUmask: number\n umask: number\n dmode: number\n fmode: number\n chmod: boolean\n\n constructor(opt: TarOptions = {}) {\n opt.ondone = () => {\n this[ENDED] = true\n this[MAYBECLOSE]()\n }\n\n super(opt)\n\n this.transform = opt.transform\n\n this.chmod = !!opt.chmod\n\n if (typeof opt.uid === 'number' || typeof opt.gid === 'number') {\n // need both or neither\n if (\n typeof opt.uid !== 'number' ||\n typeof opt.gid !== 'number'\n ) {\n throw new TypeError(\n 'cannot set owner without number uid and gid',\n )\n }\n if (opt.preserveOwner) {\n throw new TypeError(\n 'cannot preserve owner in archive and also set owner explicitly',\n )\n }\n this.uid = opt.uid\n this.gid = opt.gid\n this.setOwner = true\n } else {\n this.uid = undefined\n this.gid = undefined\n this.setOwner = false\n }\n\n // default true for root\n if (\n opt.preserveOwner === undefined &&\n typeof opt.uid !== 'number'\n ) {\n this.preserveOwner = !!(\n process.getuid && process.getuid() === 0\n )\n } else {\n this.preserveOwner = !!opt.preserveOwner\n }\n\n this.processUid =\n (this.preserveOwner || this.setOwner) && process.getuid ?\n process.getuid()\n : undefined\n this.processGid =\n (this.preserveOwner || this.setOwner) && process.getgid ?\n process.getgid()\n : undefined\n\n // prevent excessively deep nesting of subfolders\n // set to `Infinity` to remove this restriction\n this.maxDepth =\n typeof opt.maxDepth === 'number' ?\n opt.maxDepth\n : DEFAULT_MAX_DEPTH\n\n // mostly just for testing, but useful in some cases.\n // Forcibly trigger a chown on every entry, no matter what\n this.forceChown = opt.forceChown === true\n\n // turn > this[ONENTRY](entry))\n }\n\n // a bad or damaged archive is a warning for Parser, but an error\n // when extracting. Mark those errors as unrecoverable, because\n // the Unpack contract cannot be met.\n warn(code: string, msg: string | Error, data: WarnData = {}) {\n if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT') {\n data.recoverable = false\n }\n return super.warn(code, msg, data)\n }\n\n [MAYBECLOSE]() {\n if (this[ENDED] && this[PENDING] === 0) {\n this.emit('prefinish')\n this.emit('finish')\n this.emit('end')\n }\n }\n\n // return false if we need to skip this file\n // return true if the field was successfully sanitized\n [STRIPABSOLUTEPATH](\n entry: ReadEntry,\n field: 'path' | 'linkpath',\n ): boolean {\n const p = entry[field]\n const { type } = entry\n if (!p || this.preservePaths) return true\n\n const parts = p.split('/')\n\n if (\n parts.includes('..') ||\n /* c8 ignore next */\n (isWindows && /^[a-z]:\\.\\.$/i.test(parts[0] ?? ''))\n ) {\n // For linkpath, check if the resolved path escapes cwd rather than\n // just rejecting any path with '..' - relative symlinks like\n // '../sibling/file' are valid if they resolve within the cwd.\n // For paths, they just simply may not ever use .. at all.\n if (field === 'path' || type === 'Link') {\n this.warn('TAR_ENTRY_ERROR', `${field} contains '..'`, {\n entry,\n [field]: p,\n })\n // not ok!\n return false\n } else {\n // Resolve linkpath relative to the entry's directory.\n // `path.posix` is safe to use because we're operating on\n // tar paths, not a filesystem.\n const entryDir = path.posix.dirname(entry.path)\n const resolved = path.posix.normalize(\n path.posix.join(entryDir, p),\n )\n // If the resolved path escapes (starts with ..), reject it\n if (resolved.startsWith('../') || resolved === '..') {\n this.warn(\n 'TAR_ENTRY_ERROR',\n `${field} escapes extraction directory`,\n {\n entry,\n [field]: p,\n },\n )\n return false\n }\n }\n }\n\n // strip off the root\n const [root, stripped] = stripAbsolutePath(p)\n if (root) {\n // ok, but triggers warning about stripping root\n entry[field] = String(stripped)\n this.warn(\n 'TAR_ENTRY_INFO',\n `stripping ${root} from absolute ${field}`,\n {\n entry,\n [field]: p,\n },\n )\n }\n return true\n }\n\n [CHECKPATH](entry: ReadEntry) {\n const p = normalizeWindowsPath(entry.path)\n const parts = p.split('/')\n\n if (this.strip) {\n if (parts.length < this.strip) {\n return false\n }\n if (entry.type === 'Link') {\n const linkparts = normalizeWindowsPath(\n String(entry.linkpath),\n ).split('/')\n if (linkparts.length >= this.strip) {\n entry.linkpath = linkparts.slice(this.strip).join('/')\n } else {\n return false\n }\n }\n parts.splice(0, this.strip)\n entry.path = parts.join('/')\n }\n\n if (isFinite(this.maxDepth) && parts.length > this.maxDepth) {\n this.warn('TAR_ENTRY_ERROR', 'path excessively deep', {\n entry,\n path: p,\n depth: parts.length,\n maxDepth: this.maxDepth,\n })\n return false\n }\n\n if (\n !this[STRIPABSOLUTEPATH](entry, 'path') ||\n !this[STRIPABSOLUTEPATH](entry, 'linkpath')\n ) {\n return false\n }\n\n if (path.isAbsolute(entry.path)) {\n entry.absolute = normalizeWindowsPath(path.resolve(entry.path))\n } else {\n entry.absolute = normalizeWindowsPath(\n path.resolve(this.cwd, entry.path),\n )\n }\n\n // if we somehow ended up with a path that escapes the cwd, and we are\n // not in preservePaths mode, then something is fishy! This should have\n // been prevented above, so ignore this for coverage.\n /* c8 ignore start - defense in depth */\n if (\n !this.preservePaths &&\n typeof entry.absolute === 'string' &&\n entry.absolute.indexOf(this.cwd + '/') !== 0 &&\n entry.absolute !== this.cwd\n ) {\n this.warn('TAR_ENTRY_ERROR', 'path escaped extraction target', {\n entry,\n path: normalizeWindowsPath(entry.path),\n resolvedPath: entry.absolute,\n cwd: this.cwd,\n })\n return false\n }\n /* c8 ignore stop */\n\n // an archive can set properties on the extraction directory, but it\n // may not replace the cwd with a different kind of thing entirely.\n if (\n entry.absolute === this.cwd &&\n entry.type !== 'Directory' &&\n entry.type !== 'GNUDumpDir'\n ) {\n return false\n }\n\n // only encode : chars that aren't drive letter indicators\n if (this.win32) {\n const { root: aRoot } = path.win32.parse(String(entry.absolute))\n entry.absolute =\n aRoot + wc.encode(String(entry.absolute).slice(aRoot.length))\n const { root: pRoot } = path.win32.parse(entry.path)\n entry.path = pRoot + wc.encode(entry.path.slice(pRoot.length))\n }\n\n return true\n }\n\n [ONENTRY](entry: ReadEntry) {\n if (!this[CHECKPATH](entry)) {\n return entry.resume()\n }\n\n assert.equal(typeof entry.absolute, 'string')\n\n switch (entry.type) {\n case 'Directory':\n case 'GNUDumpDir':\n if (entry.mode) {\n entry.mode = entry.mode | 0o700\n }\n\n // eslint-disable-next-line no-fallthrough\n case 'File':\n case 'OldFile':\n case 'ContiguousFile':\n case 'Link':\n case 'SymbolicLink':\n return this[CHECKFS](entry)\n\n case 'CharacterDevice':\n case 'BlockDevice':\n case 'FIFO':\n default:\n return this[UNSUPPORTED](entry)\n }\n }\n\n [ONERROR](er: Error, entry: ReadEntry) {\n // Cwd has to exist, or else nothing works. That's serious.\n // Other errors are warnings, which raise the error in strict\n // mode, but otherwise continue on.\n if (er.name === 'CwdError') {\n this.emit('error', er)\n } else {\n this.warn('TAR_ENTRY_ERROR', er, { entry })\n this[UNPEND]()\n entry.resume()\n }\n }\n\n [MKDIR](\n dir: string,\n mode: number,\n cb: (er?: null | MkdirError, made?: string) => void,\n ) {\n mkdir(\n normalizeWindowsPath(dir),\n {\n uid: this.uid,\n gid: this.gid,\n processUid: this.processUid,\n processGid: this.processGid,\n umask: this.processUmask,\n preserve: this.preservePaths,\n unlink: this.unlink,\n cwd: this.cwd,\n mode: mode,\n },\n cb,\n )\n }\n\n [DOCHOWN](entry: ReadEntry) {\n // in preserve owner mode, chown if the entry doesn't match process\n // in set owner mode, chown if setting doesn't match process\n return (\n this.forceChown ||\n (this.preserveOwner &&\n ((typeof entry.uid === 'number' &&\n entry.uid !== this.processUid) ||\n (typeof entry.gid === 'number' &&\n entry.gid !== this.processGid))) ||\n (typeof this.uid === 'number' &&\n this.uid !== this.processUid) ||\n (typeof this.gid === 'number' && this.gid !== this.processGid)\n )\n }\n\n [UID](entry: ReadEntry) {\n return uint32(this.uid, entry.uid, this.processUid)\n }\n\n [GID](entry: ReadEntry) {\n return uint32(this.gid, entry.gid, this.processGid)\n }\n\n [FILE](entry: ReadEntry, fullyDone: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.fmode\n const stream = new fsm.WriteStream(String(entry.absolute), {\n // slight lie, but it can be numeric flags\n flags: getWriteFlag(entry.size) as string,\n mode: mode,\n autoClose: false,\n })\n stream.on('error', (er: Error) => {\n if (stream.fd) {\n fs.close(stream.fd, () => {})\n }\n\n // flush all the data out so that we aren't left hanging\n // if the error wasn't actually fatal. otherwise the parse\n // is blocked, and we never proceed.\n stream.write = () => true\n this[ONERROR](er, entry)\n fullyDone()\n })\n\n let actions = 1\n const done = (er?: null | Error) => {\n if (er) {\n /* c8 ignore start - we should always have a fd by now */\n if (stream.fd) {\n fs.close(stream.fd, () => {})\n }\n /* c8 ignore stop */\n\n this[ONERROR](er, entry)\n fullyDone()\n return\n }\n\n if (--actions === 0) {\n if (stream.fd !== undefined) {\n fs.close(stream.fd, er => {\n if (er) {\n this[ONERROR](er, entry)\n } else {\n this[UNPEND]()\n }\n fullyDone()\n })\n }\n }\n }\n\n stream.on('finish', () => {\n // if futimes fails, try utimes\n // if utimes fails, fail with the original error\n // same for fchown/chown\n const abs = String(entry.absolute)\n const fd = stream.fd\n\n if (typeof fd === 'number' && entry.mtime && !this.noMtime) {\n actions++\n const atime = entry.atime || new Date()\n const mtime = entry.mtime\n fs.futimes(fd, atime, mtime, er =>\n er ?\n fs.utimes(abs, atime, mtime, er2 => done(er2 && er))\n : done(),\n )\n }\n\n if (typeof fd === 'number' && this[DOCHOWN](entry)) {\n actions++\n const uid = this[UID](entry)\n const gid = this[GID](entry)\n if (typeof uid === 'number' && typeof gid === 'number') {\n fs.fchown(fd, uid, gid, er =>\n er ?\n fs.chown(abs, uid, gid, er2 => done(er2 && er))\n : done(),\n )\n }\n }\n\n done()\n })\n\n const tx = this.transform ? this.transform(entry) || entry : entry\n if (tx !== entry) {\n tx.on('error', (er: Error) => {\n this[ONERROR](er, entry)\n fullyDone()\n })\n entry.pipe(tx)\n }\n tx.pipe(stream)\n }\n\n [DIRECTORY](entry: ReadEntry, fullyDone: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.dmode\n this[MKDIR](String(entry.absolute), mode, er => {\n if (er) {\n this[ONERROR](er, entry)\n fullyDone()\n return\n }\n\n let actions = 1\n const done = () => {\n if (--actions === 0) {\n fullyDone()\n this[UNPEND]()\n entry.resume()\n }\n }\n\n if (entry.mtime && !this.noMtime) {\n actions++\n fs.utimes(\n String(entry.absolute),\n entry.atime || new Date(),\n entry.mtime,\n done,\n )\n }\n\n if (this[DOCHOWN](entry)) {\n actions++\n fs.chown(\n String(entry.absolute),\n Number(this[UID](entry)),\n Number(this[GID](entry)),\n done,\n )\n }\n\n done()\n })\n }\n\n [UNSUPPORTED](entry: ReadEntry) {\n entry.unsupported = true\n this.warn(\n 'TAR_ENTRY_UNSUPPORTED',\n `unsupported entry type: ${entry.type}`,\n { entry },\n )\n entry.resume()\n }\n\n [SYMLINK](entry: ReadEntry, done: () => void) {\n this[LINK](entry, String(entry.linkpath), 'symlink', done)\n }\n\n [HARDLINK](entry: ReadEntry, done: () => void) {\n const linkpath = normalizeWindowsPath(\n path.resolve(this.cwd, String(entry.linkpath)),\n )\n this[LINK](entry, linkpath, 'link', done)\n }\n\n [PEND]() {\n this[PENDING]++\n }\n\n [UNPEND]() {\n this[PENDING]--\n this[MAYBECLOSE]()\n }\n\n [SKIP](entry: ReadEntry) {\n this[UNPEND]()\n entry.resume()\n }\n\n // Check if we can reuse an existing filesystem entry safely and\n // overwrite it, rather than unlinking and recreating\n // Windows doesn't report a useful nlink, so we just never reuse entries\n [ISREUSABLE](entry: ReadEntry, st: Stats) {\n return (\n entry.type === 'File' &&\n !this.unlink &&\n st.isFile() &&\n st.nlink <= 1 &&\n !isWindows\n )\n }\n\n // check if a thing is there, and if so, try to clobber it\n [CHECKFS](entry: ReadEntry) {\n this[PEND]()\n const paths = [entry.path]\n if (entry.linkpath) {\n paths.push(entry.linkpath)\n }\n this.reservations.reserve(paths, done =>\n this[CHECKFS2](entry, done),\n )\n }\n\n [CHECKFS2](entry: ReadEntry, fullyDone: (er?: Error) => void) {\n const done = (er?: Error) => {\n fullyDone(er)\n }\n\n const checkCwd = () => {\n this[MKDIR](this.cwd, this.dmode, er => {\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n this[CHECKED_CWD] = true\n start()\n })\n }\n\n const start = () => {\n if (entry.absolute !== this.cwd) {\n const parent = normalizeWindowsPath(\n path.dirname(String(entry.absolute)),\n )\n if (parent !== this.cwd) {\n return this[MKDIR](parent, this.dmode, er => {\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n afterMakeParent()\n })\n }\n }\n afterMakeParent()\n }\n\n const afterMakeParent = () => {\n fs.lstat(String(entry.absolute), (lstatEr, st) => {\n if (\n st &&\n (this.keep ||\n /* c8 ignore next */\n (this.newer && st.mtime > (entry.mtime ?? st.mtime)))\n ) {\n this[SKIP](entry)\n done()\n return\n }\n if (lstatEr || this[ISREUSABLE](entry, st)) {\n return this[MAKEFS](null, entry, done)\n }\n\n if (st.isDirectory()) {\n if (entry.type === 'Directory') {\n const needChmod =\n this.chmod &&\n entry.mode &&\n (st.mode & 0o7777) !== entry.mode\n const afterChmod = (er?: Error | null | undefined) =>\n this[MAKEFS](er ?? null, entry, done)\n if (!needChmod) {\n return afterChmod()\n }\n return fs.chmod(\n String(entry.absolute),\n Number(entry.mode),\n afterChmod,\n )\n }\n // Not a dir entry, have to remove it.\n // NB: the only way to end up with an entry that is the cwd\n // itself, in such a way that == does not detect, is a\n // tricky windows absolute path with UNC or 8.3 parts (and\n // preservePaths:true, or else it will have been stripped).\n // In that case, the user has opted out of path protections\n // explicitly, so if they blow away the cwd, c'est la vie.\n if (entry.absolute !== this.cwd) {\n return fs.rmdir(\n String(entry.absolute),\n (er?: null | Error) =>\n this[MAKEFS](er ?? null, entry, done),\n )\n }\n }\n\n // not a dir, and not reusable\n // don't remove if the cwd, we want that error\n if (entry.absolute === this.cwd) {\n return this[MAKEFS](null, entry, done)\n }\n\n unlinkFile(String(entry.absolute), er =>\n this[MAKEFS](er ?? null, entry, done),\n )\n })\n }\n\n if (this[CHECKED_CWD]) {\n start()\n } else {\n checkCwd()\n }\n }\n\n [MAKEFS](\n er: null | undefined | Error,\n entry: ReadEntry,\n done: () => void,\n ) {\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n\n switch (entry.type) {\n case 'File':\n case 'OldFile':\n case 'ContiguousFile':\n return this[FILE](entry, done)\n\n case 'Link':\n return this[HARDLINK](entry, done)\n\n case 'SymbolicLink':\n return this[SYMLINK](entry, done)\n\n case 'Directory':\n case 'GNUDumpDir':\n return this[DIRECTORY](entry, done)\n }\n }\n\n [LINK](\n entry: ReadEntry,\n linkpath: string,\n link: 'link' | 'symlink',\n done: () => void,\n ) {\n // XXX: get the type ('symlink' or 'junction') for windows\n fs[link](linkpath, String(entry.absolute), er => {\n if (er) {\n this[ONERROR](er, entry)\n } else {\n this[UNPEND]()\n entry.resume()\n }\n done()\n })\n }\n}\n\nconst callSync = (fn: () => any) => {\n try {\n return [null, fn()]\n } catch (er) {\n return [er, null]\n }\n}\n\nexport class UnpackSync extends Unpack {\n sync: true = true;\n\n [MAKEFS](er: null | Error | undefined, entry: ReadEntry) {\n return super[MAKEFS](er, entry, () => {})\n }\n\n [CHECKFS](entry: ReadEntry) {\n if (!this[CHECKED_CWD]) {\n const er = this[MKDIR](this.cwd, this.dmode)\n if (er) {\n return this[ONERROR](er as Error, entry)\n }\n this[CHECKED_CWD] = true\n }\n\n // don't bother to make the parent if the current entry is the cwd,\n // we've already checked it.\n if (entry.absolute !== this.cwd) {\n const parent = normalizeWindowsPath(\n path.dirname(String(entry.absolute)),\n )\n if (parent !== this.cwd) {\n const mkParent = this[MKDIR](parent, this.dmode)\n if (mkParent) {\n return this[ONERROR](mkParent as Error, entry)\n }\n }\n }\n\n const [lstatEr, st] = callSync(() =>\n fs.lstatSync(String(entry.absolute)),\n )\n if (\n st &&\n (this.keep ||\n /* c8 ignore next */\n (this.newer && st.mtime > (entry.mtime ?? st.mtime)))\n ) {\n return this[SKIP](entry)\n }\n\n if (lstatEr || this[ISREUSABLE](entry, st)) {\n return this[MAKEFS](null, entry)\n }\n\n if (st.isDirectory()) {\n if (entry.type === 'Directory') {\n const needChmod =\n this.chmod &&\n entry.mode &&\n (st.mode & 0o7777) !== entry.mode\n const [er] =\n needChmod ?\n callSync(() => {\n fs.chmodSync(String(entry.absolute), Number(entry.mode))\n })\n : []\n return this[MAKEFS](er, entry)\n }\n // not a dir entry, have to remove it\n const [er] = callSync(() =>\n fs.rmdirSync(String(entry.absolute)),\n )\n this[MAKEFS](er, entry)\n }\n\n // not a dir, and not reusable.\n // don't remove if it's the cwd, since we want that error.\n const [er] =\n entry.absolute === this.cwd ?\n []\n : callSync(() => unlinkFileSync(String(entry.absolute)))\n this[MAKEFS](er, entry)\n }\n\n [FILE](entry: ReadEntry, done: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.fmode\n\n const oner = (er?: null | Error | undefined) => {\n let closeError\n try {\n fs.closeSync(fd)\n } catch (e) {\n closeError = e\n }\n if (er || closeError) {\n this[ONERROR]((er as Error) || closeError, entry)\n }\n done()\n }\n\n let fd: number\n try {\n fd = fs.openSync(\n String(entry.absolute),\n getWriteFlag(entry.size),\n mode,\n )\n /* c8 ignore start - This is only a problem if the file was successfully\n * statted, BUT failed to open. Testing this is annoying, and we\n * already have ample testint for other uses of oner() methods.\n */\n } catch (er) {\n return oner(er as Error)\n }\n /* c8 ignore stop */\n const tx = this.transform ? this.transform(entry) || entry : entry\n if (tx !== entry) {\n tx.on('error', (er: Error) => this[ONERROR](er, entry))\n entry.pipe(tx)\n }\n\n tx.on('data', (chunk: Buffer) => {\n try {\n fs.writeSync(fd, chunk, 0, chunk.length)\n } catch (er) {\n oner(er as Error)\n }\n })\n\n tx.on('end', () => {\n let er = null\n // try both, falling futimes back to utimes\n // if either fails, handle the first error\n if (entry.mtime && !this.noMtime) {\n const atime = entry.atime || new Date()\n const mtime = entry.mtime\n try {\n fs.futimesSync(fd, atime, mtime)\n } catch (futimeser) {\n try {\n fs.utimesSync(String(entry.absolute), atime, mtime)\n } catch (utimeser) {\n er = futimeser\n }\n }\n }\n\n if (this[DOCHOWN](entry)) {\n const uid = this[UID](entry)\n const gid = this[GID](entry)\n\n try {\n fs.fchownSync(fd, Number(uid), Number(gid))\n } catch (fchowner) {\n try {\n fs.chownSync(\n String(entry.absolute),\n Number(uid),\n Number(gid),\n )\n } catch (chowner) {\n er = er || fchowner\n }\n }\n }\n\n oner(er as Error)\n })\n }\n\n [DIRECTORY](entry: ReadEntry, done: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.dmode\n const er = this[MKDIR](String(entry.absolute), mode)\n if (er) {\n this[ONERROR](er as Error, entry)\n done()\n return\n }\n if (entry.mtime && !this.noMtime) {\n try {\n fs.utimesSync(\n String(entry.absolute),\n entry.atime || new Date(),\n entry.mtime,\n )\n /* c8 ignore next */\n } catch (er) {}\n }\n if (this[DOCHOWN](entry)) {\n try {\n fs.chownSync(\n String(entry.absolute),\n Number(this[UID](entry)),\n Number(this[GID](entry)),\n )\n } catch (er) {}\n }\n done()\n entry.resume()\n }\n\n [MKDIR](dir: string, mode: number) {\n try {\n return mkdirSync(normalizeWindowsPath(dir), {\n uid: this.uid,\n gid: this.gid,\n processUid: this.processUid,\n processGid: this.processGid,\n umask: this.processUmask,\n preserve: this.preservePaths,\n unlink: this.unlink,\n cwd: this.cwd,\n mode: mode,\n })\n } catch (er) {\n return er\n }\n }\n\n [LINK](\n entry: ReadEntry,\n linkpath: string,\n link: 'link' | 'symlink',\n done: () => void,\n ) {\n const ls: `${typeof link}Sync` = `${link}Sync`\n try {\n fs[ls](linkpath, String(entry.absolute))\n done()\n entry.resume()\n } catch (er) {\n return this[ONERROR](er as Error, entry)\n }\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"unpack.js","sourceRoot":"","sources":["../../src/unpack.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;AACxE,8DAA8D;AAE9D,OAAO,KAAK,GAAG,MAAM,qBAAqB,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IAAgB,EAChB,OAAmC;QAEnC,IAAI,IAAI,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,MAAM;YAAE,OAAO,IAAI,EAAE,CAAA;QACtD,IAAI,CAAC,GAAG,GAAG,CAAA;QACX,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;YACtB,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YACtB,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;YAChD,IAAI,EAAE;gBAAE,OAAO,IAAI,EAAE,CAAA;YACrB,IAAI,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC;gBACxB,OAAO,OAAO,CACZ,IAAI,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CACxD,CAAA;YACH,CAAC;QACH,CAAC;QACD,IAAI,EAAE,CAAA;IACR,CAAC;IAED,CAAC,IAAI,CAAC,CACJ,KAAgB,EAChB,QAAgB,EAChB,IAAwB,EACxB,IAAgB;QAEhB,MAAM,QAAQ,GAAyB,GAAG,IAAI,MAAM,CAAA;QACpD,IAAI,CAAC;YACH,EAAE,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;YAC9C,IAAI,EAAE,CAAA;YACN,KAAK,CAAC,MAAM,EAAE,CAAA;QAChB,CAAC;QAAC,OAAO,EAAE,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,EAAW,EAAE,KAAK,CAAC,CAAA;QAC1C,CAAC;IACH,CAAC;CACF","sourcesContent":["// the PEND/UNPEND stuff tracks whether we're ready to emit end/close yet.\n// but the path reservations are required to avoid race conditions where\n// parallelized unpack ops may mess with one another, due to dependencies\n// (like a Link depending on its target) or destructive operations (like\n// clobbering an fs object to create one of a different type.)\n\nimport * as fsm from '@isaacs/fs-minipass'\nimport assert from 'node:assert'\nimport { randomBytes } from 'node:crypto'\nimport fs, { type Stats } from 'node:fs'\nimport path from 'node:path'\nimport { getWriteFlag } from './get-write-flag.js'\nimport { mkdir, MkdirError, mkdirSync } from './mkdir.js'\nimport { normalizeWindowsPath } from './normalize-windows-path.js'\nimport { Parser } from './parse.js'\nimport { stripAbsolutePath } from './strip-absolute-path.js'\nimport * as wc from './winchars.js'\n\nimport { TarOptions } from './options.js'\nimport { PathReservations } from './path-reservations.js'\nimport { ReadEntry } from './read-entry.js'\nimport { WarnData } from './warn-method.js'\nimport { SymlinkError } from './symlink-error.js'\nimport { umask } from './process-umask.js'\n\nconst ONENTRY = Symbol('onEntry')\nconst CHECKFS = Symbol('checkFs')\nconst CHECKFS2 = Symbol('checkFs2')\nconst ISREUSABLE = Symbol('isReusable')\nconst MAKEFS = Symbol('makeFs')\nconst FILE = Symbol('file')\nconst DIRECTORY = Symbol('directory')\nconst LINK = Symbol('link')\nconst SYMLINK = Symbol('symlink')\nconst HARDLINK = Symbol('hardlink')\nconst ENSURE_NO_SYMLINK = Symbol('ensureNoSymlink')\nconst UNSUPPORTED = Symbol('unsupported')\nconst CHECKPATH = Symbol('checkPath')\nconst STRIPABSOLUTEPATH = Symbol('stripAbsolutePath')\nconst MKDIR = Symbol('mkdir')\nconst ONERROR = Symbol('onError')\nconst PENDING = Symbol('pending')\nconst PEND = Symbol('pend')\nconst UNPEND = Symbol('unpend')\nconst ENDED = Symbol('ended')\nconst MAYBECLOSE = Symbol('maybeClose')\nconst SKIP = Symbol('skip')\nconst DOCHOWN = Symbol('doChown')\nconst UID = Symbol('uid')\nconst GID = Symbol('gid')\nconst CHECKED_CWD = Symbol('checkedCwd')\nconst platform =\n process.env.TESTING_TAR_FAKE_PLATFORM || process.platform\nconst isWindows = platform === 'win32'\nconst DEFAULT_MAX_DEPTH = 1024\n\n// Unlinks on Windows are not atomic.\n//\n// This means that if you have a file entry, followed by another\n// file entry with an identical name, and you cannot re-use the file\n// (because it's a hardlink, or because unlink:true is set, or it's\n// Windows, which does not have useful nlink values), then the unlink\n// will be committed to the disk AFTER the new file has been written\n// over the old one, deleting the new file.\n//\n// To work around this, on Windows systems, we rename the file and then\n// delete the renamed file. It's a sloppy kludge, but frankly, I do not\n// know of a better way to do this, given windows' non-atomic unlink\n// semantics.\n//\n// See: https://github.com/npm/node-tar/issues/183\n/* c8 ignore start */\nconst unlinkFile = (\n path: string,\n cb: (er?: Error | null) => void,\n) => {\n if (!isWindows) {\n return fs.unlink(path, cb)\n }\n\n const name = path + '.DELETE.' + randomBytes(16).toString('hex')\n fs.rename(path, name, er => {\n if (er) {\n return cb(er)\n }\n fs.unlink(name, cb)\n })\n}\n/* c8 ignore stop */\n\n/* c8 ignore start */\nconst unlinkFileSync = (path: string) => {\n if (!isWindows) {\n return fs.unlinkSync(path)\n }\n\n const name = path + '.DELETE.' + randomBytes(16).toString('hex')\n fs.renameSync(path, name)\n fs.unlinkSync(name)\n}\n/* c8 ignore stop */\n\n// this.gid, entry.gid, this.processUid\nconst uint32 = (\n a: number | undefined,\n b: number | undefined,\n c: number | undefined,\n) =>\n a !== undefined && a === a >>> 0 ? a\n : b !== undefined && b === b >>> 0 ? b\n : c\n\nexport class Unpack extends Parser {\n [ENDED]: boolean = false;\n [CHECKED_CWD]: boolean = false;\n [PENDING]: number = 0\n\n reservations: PathReservations = new PathReservations()\n transform?: TarOptions['transform']\n writable: true = true\n readable: false = false\n uid?: number\n gid?: number\n setOwner: boolean\n preserveOwner: boolean\n processGid?: number\n processUid?: number\n maxDepth: number\n forceChown: boolean\n win32: boolean\n newer: boolean\n keep: boolean\n noMtime: boolean\n preservePaths: boolean\n unlink: boolean\n cwd: string\n strip: number\n processUmask: number\n umask: number\n dmode: number\n fmode: number\n chmod: boolean\n\n constructor(opt: TarOptions = {}) {\n opt.ondone = () => {\n this[ENDED] = true\n this[MAYBECLOSE]()\n }\n\n super(opt)\n\n this.transform = opt.transform\n\n this.chmod = !!opt.chmod\n\n if (typeof opt.uid === 'number' || typeof opt.gid === 'number') {\n // need both or neither\n if (\n typeof opt.uid !== 'number' ||\n typeof opt.gid !== 'number'\n ) {\n throw new TypeError(\n 'cannot set owner without number uid and gid',\n )\n }\n if (opt.preserveOwner) {\n throw new TypeError(\n 'cannot preserve owner in archive and also set owner explicitly',\n )\n }\n this.uid = opt.uid\n this.gid = opt.gid\n this.setOwner = true\n } else {\n this.uid = undefined\n this.gid = undefined\n this.setOwner = false\n }\n\n // default true for root\n if (\n opt.preserveOwner === undefined &&\n typeof opt.uid !== 'number'\n ) {\n this.preserveOwner = !!(\n process.getuid && process.getuid() === 0\n )\n } else {\n this.preserveOwner = !!opt.preserveOwner\n }\n\n this.processUid =\n (this.preserveOwner || this.setOwner) && process.getuid ?\n process.getuid()\n : undefined\n this.processGid =\n (this.preserveOwner || this.setOwner) && process.getgid ?\n process.getgid()\n : undefined\n\n // prevent excessively deep nesting of subfolders\n // set to `Infinity` to remove this restriction\n this.maxDepth =\n typeof opt.maxDepth === 'number' ?\n opt.maxDepth\n : DEFAULT_MAX_DEPTH\n\n // mostly just for testing, but useful in some cases.\n // Forcibly trigger a chown on every entry, no matter what\n this.forceChown = opt.forceChown === true\n\n // turn > this[ONENTRY](entry))\n }\n\n // a bad or damaged archive is a warning for Parser, but an error\n // when extracting. Mark those errors as unrecoverable, because\n // the Unpack contract cannot be met.\n warn(code: string, msg: string | Error, data: WarnData = {}) {\n if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT') {\n data.recoverable = false\n }\n return super.warn(code, msg, data)\n }\n\n [MAYBECLOSE]() {\n if (this[ENDED] && this[PENDING] === 0) {\n this.emit('prefinish')\n this.emit('finish')\n this.emit('end')\n }\n }\n\n // return false if we need to skip this file\n // return true if the field was successfully sanitized\n [STRIPABSOLUTEPATH](\n entry: ReadEntry,\n field: 'path' | 'linkpath',\n ): boolean {\n const p = entry[field]\n const { type } = entry\n if (!p || this.preservePaths) return true\n\n const parts = p.split('/')\n\n if (\n parts.includes('..') ||\n /* c8 ignore next */\n (isWindows && /^[a-z]:\\.\\.$/i.test(parts[0] ?? ''))\n ) {\n // For linkpath, check if the resolved path escapes cwd rather than\n // just rejecting any path with '..' - relative symlinks like\n // '../sibling/file' are valid if they resolve within the cwd.\n // For paths, they just simply may not ever use .. at all.\n if (field === 'path' || type === 'Link') {\n this.warn('TAR_ENTRY_ERROR', `${field} contains '..'`, {\n entry,\n [field]: p,\n })\n // not ok!\n return false\n } else {\n // Resolve linkpath relative to the entry's directory.\n // `path.posix` is safe to use because we're operating on\n // tar paths, not a filesystem.\n const entryDir = path.posix.dirname(entry.path)\n const resolved = path.posix.normalize(\n path.posix.join(entryDir, p),\n )\n // If the resolved path escapes (starts with ..), reject it\n if (resolved.startsWith('../') || resolved === '..') {\n this.warn(\n 'TAR_ENTRY_ERROR',\n `${field} escapes extraction directory`,\n {\n entry,\n [field]: p,\n },\n )\n return false\n }\n }\n }\n\n // strip off the root\n const [root, stripped] = stripAbsolutePath(p)\n if (root) {\n // ok, but triggers warning about stripping root\n entry[field] = String(stripped)\n this.warn(\n 'TAR_ENTRY_INFO',\n `stripping ${root} from absolute ${field}`,\n {\n entry,\n [field]: p,\n },\n )\n }\n return true\n }\n\n // no IO, just string checking for absolute indicators\n [CHECKPATH](entry: ReadEntry) {\n const p = normalizeWindowsPath(entry.path)\n const parts = p.split('/')\n\n if (this.strip) {\n if (parts.length < this.strip) {\n return false\n }\n if (entry.type === 'Link') {\n const linkparts = normalizeWindowsPath(\n String(entry.linkpath),\n ).split('/')\n if (linkparts.length >= this.strip) {\n entry.linkpath = linkparts.slice(this.strip).join('/')\n } else {\n return false\n }\n }\n parts.splice(0, this.strip)\n entry.path = parts.join('/')\n }\n\n if (isFinite(this.maxDepth) && parts.length > this.maxDepth) {\n this.warn('TAR_ENTRY_ERROR', 'path excessively deep', {\n entry,\n path: p,\n depth: parts.length,\n maxDepth: this.maxDepth,\n })\n return false\n }\n\n if (\n !this[STRIPABSOLUTEPATH](entry, 'path') ||\n !this[STRIPABSOLUTEPATH](entry, 'linkpath')\n ) {\n return false\n }\n\n if (path.isAbsolute(entry.path)) {\n entry.absolute = normalizeWindowsPath(path.resolve(entry.path))\n } else {\n entry.absolute = normalizeWindowsPath(\n path.resolve(this.cwd, entry.path),\n )\n }\n\n // if we somehow ended up with a path that escapes the cwd, and we are\n // not in preservePaths mode, then something is fishy! This should have\n // been prevented above, so ignore this for coverage.\n /* c8 ignore start - defense in depth */\n if (\n !this.preservePaths &&\n typeof entry.absolute === 'string' &&\n entry.absolute.indexOf(this.cwd + '/') !== 0 &&\n entry.absolute !== this.cwd\n ) {\n this.warn('TAR_ENTRY_ERROR', 'path escaped extraction target', {\n entry,\n path: normalizeWindowsPath(entry.path),\n resolvedPath: entry.absolute,\n cwd: this.cwd,\n })\n return false\n }\n /* c8 ignore stop */\n\n // an archive can set properties on the extraction directory, but it\n // may not replace the cwd with a different kind of thing entirely.\n if (\n entry.absolute === this.cwd &&\n entry.type !== 'Directory' &&\n entry.type !== 'GNUDumpDir'\n ) {\n return false\n }\n\n // only encode : chars that aren't drive letter indicators\n if (this.win32) {\n const { root: aRoot } = path.win32.parse(String(entry.absolute))\n entry.absolute =\n aRoot + wc.encode(String(entry.absolute).slice(aRoot.length))\n const { root: pRoot } = path.win32.parse(entry.path)\n entry.path = pRoot + wc.encode(entry.path.slice(pRoot.length))\n }\n\n return true\n }\n\n [ONENTRY](entry: ReadEntry) {\n if (!this[CHECKPATH](entry)) {\n return entry.resume()\n }\n\n assert.equal(typeof entry.absolute, 'string')\n\n switch (entry.type) {\n case 'Directory':\n case 'GNUDumpDir':\n if (entry.mode) {\n entry.mode = entry.mode | 0o700\n }\n\n // eslint-disable-next-line no-fallthrough\n case 'File':\n case 'OldFile':\n case 'ContiguousFile':\n case 'Link':\n case 'SymbolicLink':\n return this[CHECKFS](entry)\n\n case 'CharacterDevice':\n case 'BlockDevice':\n case 'FIFO':\n default:\n return this[UNSUPPORTED](entry)\n }\n }\n\n [ONERROR](er: Error, entry: ReadEntry) {\n // Cwd has to exist, or else nothing works. That's serious.\n // Other errors are warnings, which raise the error in strict\n // mode, but otherwise continue on.\n if (er.name === 'CwdError') {\n this.emit('error', er)\n } else {\n this.warn('TAR_ENTRY_ERROR', er, { entry })\n this[UNPEND]()\n entry.resume()\n }\n }\n\n [MKDIR](\n dir: string,\n mode: number,\n cb: (er?: null | MkdirError, made?: string) => void,\n ) {\n mkdir(\n normalizeWindowsPath(dir),\n {\n uid: this.uid,\n gid: this.gid,\n processUid: this.processUid,\n processGid: this.processGid,\n umask: this.processUmask,\n preserve: this.preservePaths,\n unlink: this.unlink,\n cwd: this.cwd,\n mode: mode,\n },\n cb,\n )\n }\n\n [DOCHOWN](entry: ReadEntry) {\n // in preserve owner mode, chown if the entry doesn't match process\n // in set owner mode, chown if setting doesn't match process\n return (\n this.forceChown ||\n (this.preserveOwner &&\n ((typeof entry.uid === 'number' &&\n entry.uid !== this.processUid) ||\n (typeof entry.gid === 'number' &&\n entry.gid !== this.processGid))) ||\n (typeof this.uid === 'number' &&\n this.uid !== this.processUid) ||\n (typeof this.gid === 'number' && this.gid !== this.processGid)\n )\n }\n\n [UID](entry: ReadEntry) {\n return uint32(this.uid, entry.uid, this.processUid)\n }\n\n [GID](entry: ReadEntry) {\n return uint32(this.gid, entry.gid, this.processGid)\n }\n\n [FILE](entry: ReadEntry, fullyDone: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.fmode\n const stream = new fsm.WriteStream(String(entry.absolute), {\n // slight lie, but it can be numeric flags\n flags: getWriteFlag(entry.size) as string,\n mode: mode,\n autoClose: false,\n })\n stream.on('error', (er: Error) => {\n if (stream.fd) {\n fs.close(stream.fd, () => {})\n }\n\n // flush all the data out so that we aren't left hanging\n // if the error wasn't actually fatal. otherwise the parse\n // is blocked, and we never proceed.\n stream.write = () => true\n this[ONERROR](er, entry)\n fullyDone()\n })\n\n let actions = 1\n const done = (er?: null | Error) => {\n if (er) {\n /* c8 ignore start - we should always have a fd by now */\n if (stream.fd) {\n fs.close(stream.fd, () => {})\n }\n /* c8 ignore stop */\n\n this[ONERROR](er, entry)\n fullyDone()\n return\n }\n\n if (--actions === 0) {\n if (stream.fd !== undefined) {\n fs.close(stream.fd, er => {\n if (er) {\n this[ONERROR](er, entry)\n } else {\n this[UNPEND]()\n }\n fullyDone()\n })\n }\n }\n }\n\n stream.on('finish', () => {\n // if futimes fails, try utimes\n // if utimes fails, fail with the original error\n // same for fchown/chown\n const abs = String(entry.absolute)\n const fd = stream.fd\n\n if (typeof fd === 'number' && entry.mtime && !this.noMtime) {\n actions++\n const atime = entry.atime || new Date()\n const mtime = entry.mtime\n fs.futimes(fd, atime, mtime, er =>\n er ?\n fs.utimes(abs, atime, mtime, er2 => done(er2 && er))\n : done(),\n )\n }\n\n if (typeof fd === 'number' && this[DOCHOWN](entry)) {\n actions++\n const uid = this[UID](entry)\n const gid = this[GID](entry)\n if (typeof uid === 'number' && typeof gid === 'number') {\n fs.fchown(fd, uid, gid, er =>\n er ?\n fs.chown(abs, uid, gid, er2 => done(er2 && er))\n : done(),\n )\n }\n }\n\n done()\n })\n\n const tx = this.transform ? this.transform(entry) || entry : entry\n if (tx !== entry) {\n tx.on('error', (er: Error) => {\n this[ONERROR](er, entry)\n fullyDone()\n })\n entry.pipe(tx)\n }\n tx.pipe(stream)\n }\n\n [DIRECTORY](entry: ReadEntry, fullyDone: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.dmode\n this[MKDIR](String(entry.absolute), mode, er => {\n if (er) {\n this[ONERROR](er, entry)\n fullyDone()\n return\n }\n\n let actions = 1\n const done = () => {\n if (--actions === 0) {\n fullyDone()\n this[UNPEND]()\n entry.resume()\n }\n }\n\n if (entry.mtime && !this.noMtime) {\n actions++\n fs.utimes(\n String(entry.absolute),\n entry.atime || new Date(),\n entry.mtime,\n done,\n )\n }\n\n if (this[DOCHOWN](entry)) {\n actions++\n fs.chown(\n String(entry.absolute),\n Number(this[UID](entry)),\n Number(this[GID](entry)),\n done,\n )\n }\n\n done()\n })\n }\n\n [UNSUPPORTED](entry: ReadEntry) {\n entry.unsupported = true\n this.warn(\n 'TAR_ENTRY_UNSUPPORTED',\n `unsupported entry type: ${entry.type}`,\n { entry },\n )\n entry.resume()\n }\n\n [SYMLINK](entry: ReadEntry, done: () => void) {\n const parts = normalizeWindowsPath(\n path.relative(\n this.cwd,\n path.resolve(\n path.dirname(String(entry.absolute)),\n String(entry.linkpath),\n ),\n ),\n ).split('/')\n this[ENSURE_NO_SYMLINK](\n entry,\n this.cwd,\n parts,\n () =>\n this[LINK](entry, String(entry.linkpath), 'symlink', done),\n er => {\n this[ONERROR](er, entry)\n done()\n },\n )\n }\n\n [HARDLINK](entry: ReadEntry, done: () => void) {\n const linkpath = normalizeWindowsPath(\n path.resolve(this.cwd, String(entry.linkpath)),\n )\n const parts = normalizeWindowsPath(String(entry.linkpath)).split(\n '/',\n )\n this[ENSURE_NO_SYMLINK](\n entry,\n this.cwd,\n parts,\n () => this[LINK](entry, linkpath, 'link', done),\n er => {\n this[ONERROR](er, entry)\n done()\n },\n )\n }\n\n [ENSURE_NO_SYMLINK](\n entry: ReadEntry,\n cwd: string,\n parts: string[],\n done: () => void,\n onError: (er: SymlinkError) => void,\n ) {\n const p = parts.shift()\n if (this.preservePaths || p === undefined) return done()\n const t = path.resolve(cwd, p)\n fs.lstat(t, (er, st) => {\n if (er) return done()\n if (st?.isSymbolicLink()) {\n return onError(\n new SymlinkError(t, path.resolve(t, parts.join('/'))),\n )\n }\n this[ENSURE_NO_SYMLINK](entry, t, parts, done, onError)\n })\n }\n\n [PEND]() {\n this[PENDING]++\n }\n\n [UNPEND]() {\n this[PENDING]--\n this[MAYBECLOSE]()\n }\n\n [SKIP](entry: ReadEntry) {\n this[UNPEND]()\n entry.resume()\n }\n\n // Check if we can reuse an existing filesystem entry safely and\n // overwrite it, rather than unlinking and recreating\n // Windows doesn't report a useful nlink, so we just never reuse entries\n [ISREUSABLE](entry: ReadEntry, st: Stats) {\n return (\n entry.type === 'File' &&\n !this.unlink &&\n st.isFile() &&\n st.nlink <= 1 &&\n !isWindows\n )\n }\n\n // check if a thing is there, and if so, try to clobber it\n [CHECKFS](entry: ReadEntry) {\n this[PEND]()\n const paths = [entry.path]\n if (entry.linkpath) {\n paths.push(entry.linkpath)\n }\n this.reservations.reserve(paths, done =>\n this[CHECKFS2](entry, done),\n )\n }\n\n [CHECKFS2](entry: ReadEntry, fullyDone: (er?: Error) => void) {\n const done = (er?: Error) => {\n fullyDone(er)\n }\n\n const checkCwd = () => {\n this[MKDIR](this.cwd, this.dmode, er => {\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n this[CHECKED_CWD] = true\n start()\n })\n }\n\n const start = () => {\n if (entry.absolute !== this.cwd) {\n const parent = normalizeWindowsPath(\n path.dirname(String(entry.absolute)),\n )\n if (parent !== this.cwd) {\n return this[MKDIR](parent, this.dmode, er => {\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n afterMakeParent()\n })\n }\n }\n afterMakeParent()\n }\n\n const afterMakeParent = () => {\n fs.lstat(String(entry.absolute), (lstatEr, st) => {\n if (\n st &&\n (this.keep ||\n /* c8 ignore next */\n (this.newer && st.mtime > (entry.mtime ?? st.mtime)))\n ) {\n this[SKIP](entry)\n done()\n return\n }\n if (lstatEr || this[ISREUSABLE](entry, st)) {\n return this[MAKEFS](null, entry, done)\n }\n\n if (st.isDirectory()) {\n if (entry.type === 'Directory') {\n const needChmod =\n this.chmod &&\n entry.mode &&\n (st.mode & 0o7777) !== entry.mode\n const afterChmod = (er?: Error | null | undefined) =>\n this[MAKEFS](er ?? null, entry, done)\n if (!needChmod) {\n return afterChmod()\n }\n return fs.chmod(\n String(entry.absolute),\n Number(entry.mode),\n afterChmod,\n )\n }\n // Not a dir entry, have to remove it.\n // NB: the only way to end up with an entry that is the cwd\n // itself, in such a way that == does not detect, is a\n // tricky windows absolute path with UNC or 8.3 parts (and\n // preservePaths:true, or else it will have been stripped).\n // In that case, the user has opted out of path protections\n // explicitly, so if they blow away the cwd, c'est la vie.\n if (entry.absolute !== this.cwd) {\n return fs.rmdir(\n String(entry.absolute),\n (er?: null | Error) =>\n this[MAKEFS](er ?? null, entry, done),\n )\n }\n }\n\n // not a dir, and not reusable\n // don't remove if the cwd, we want that error\n if (entry.absolute === this.cwd) {\n return this[MAKEFS](null, entry, done)\n }\n\n unlinkFile(String(entry.absolute), er =>\n this[MAKEFS](er ?? null, entry, done),\n )\n })\n }\n\n if (this[CHECKED_CWD]) {\n start()\n } else {\n checkCwd()\n }\n }\n\n [MAKEFS](\n er: null | undefined | Error,\n entry: ReadEntry,\n done: () => void,\n ) {\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n\n switch (entry.type) {\n case 'File':\n case 'OldFile':\n case 'ContiguousFile':\n return this[FILE](entry, done)\n\n case 'Link':\n return this[HARDLINK](entry, done)\n\n case 'SymbolicLink':\n return this[SYMLINK](entry, done)\n\n case 'Directory':\n case 'GNUDumpDir':\n return this[DIRECTORY](entry, done)\n }\n }\n\n [LINK](\n entry: ReadEntry,\n linkpath: string,\n link: 'link' | 'symlink',\n done: () => void,\n ) {\n fs[link](linkpath, String(entry.absolute), er => {\n if (er) {\n this[ONERROR](er, entry)\n } else {\n this[UNPEND]()\n entry.resume()\n }\n done()\n })\n }\n}\n\nconst callSync = (\n fn: () => T,\n): [null, T] | [NodeJS.ErrnoException, null] => {\n try {\n return [null, fn()]\n } catch (er) {\n return [er as NodeJS.ErrnoException, null]\n }\n}\n\nexport class UnpackSync extends Unpack {\n sync: true = true;\n\n [MAKEFS](er: null | Error | undefined, entry: ReadEntry) {\n return super[MAKEFS](er, entry, () => {})\n }\n\n [CHECKFS](entry: ReadEntry) {\n if (!this[CHECKED_CWD]) {\n const er = this[MKDIR](this.cwd, this.dmode)\n if (er) {\n return this[ONERROR](er as Error, entry)\n }\n this[CHECKED_CWD] = true\n }\n\n // don't bother to make the parent if the current entry is the cwd,\n // we've already checked it.\n if (entry.absolute !== this.cwd) {\n const parent = normalizeWindowsPath(\n path.dirname(String(entry.absolute)),\n )\n if (parent !== this.cwd) {\n const mkParent = this[MKDIR](parent, this.dmode)\n if (mkParent) {\n return this[ONERROR](mkParent as Error, entry)\n }\n }\n }\n\n const [lstatEr, st] = callSync(() =>\n fs.lstatSync(String(entry.absolute)),\n )\n if (\n st &&\n (this.keep ||\n /* c8 ignore next */\n (this.newer && st.mtime > (entry.mtime ?? st.mtime)))\n ) {\n return this[SKIP](entry)\n }\n\n if (lstatEr || this[ISREUSABLE](entry, st)) {\n return this[MAKEFS](null, entry)\n }\n\n if (st.isDirectory()) {\n if (entry.type === 'Directory') {\n const needChmod =\n this.chmod &&\n entry.mode &&\n (st.mode & 0o7777) !== entry.mode\n const [er] =\n needChmod ?\n callSync(() => {\n fs.chmodSync(String(entry.absolute), Number(entry.mode))\n })\n : []\n return this[MAKEFS](er, entry)\n }\n // not a dir entry, have to remove it\n const [er] = callSync(() =>\n fs.rmdirSync(String(entry.absolute)),\n )\n this[MAKEFS](er, entry)\n }\n\n // not a dir, and not reusable.\n // don't remove if it's the cwd, since we want that error.\n const [er] =\n entry.absolute === this.cwd ?\n []\n : callSync(() => unlinkFileSync(String(entry.absolute)))\n this[MAKEFS](er, entry)\n }\n\n [FILE](entry: ReadEntry, done: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.fmode\n\n const oner = (er?: null | Error | undefined) => {\n let closeError\n try {\n fs.closeSync(fd)\n } catch (e) {\n closeError = e\n }\n if (er || closeError) {\n this[ONERROR]((er as Error) || closeError, entry)\n }\n done()\n }\n\n let fd: number\n try {\n fd = fs.openSync(\n String(entry.absolute),\n getWriteFlag(entry.size),\n mode,\n )\n /* c8 ignore start - This is only a problem if the file was successfully\n * statted, BUT failed to open. Testing this is annoying, and we\n * already have ample testint for other uses of oner() methods.\n */\n } catch (er) {\n return oner(er as Error)\n }\n /* c8 ignore stop */\n const tx = this.transform ? this.transform(entry) || entry : entry\n if (tx !== entry) {\n tx.on('error', (er: Error) => this[ONERROR](er, entry))\n entry.pipe(tx)\n }\n\n tx.on('data', (chunk: Buffer) => {\n try {\n fs.writeSync(fd, chunk, 0, chunk.length)\n } catch (er) {\n oner(er as Error)\n }\n })\n\n tx.on('end', () => {\n let er = null\n // try both, falling futimes back to utimes\n // if either fails, handle the first error\n if (entry.mtime && !this.noMtime) {\n const atime = entry.atime || new Date()\n const mtime = entry.mtime\n try {\n fs.futimesSync(fd, atime, mtime)\n } catch (futimeser) {\n try {\n fs.utimesSync(String(entry.absolute), atime, mtime)\n } catch (utimeser) {\n er = futimeser\n }\n }\n }\n\n if (this[DOCHOWN](entry)) {\n const uid = this[UID](entry)\n const gid = this[GID](entry)\n\n try {\n fs.fchownSync(fd, Number(uid), Number(gid))\n } catch (fchowner) {\n try {\n fs.chownSync(\n String(entry.absolute),\n Number(uid),\n Number(gid),\n )\n } catch (chowner) {\n er = er || fchowner\n }\n }\n }\n\n oner(er as Error)\n })\n }\n\n [DIRECTORY](entry: ReadEntry, done: () => void) {\n const mode =\n typeof entry.mode === 'number' ?\n entry.mode & 0o7777\n : this.dmode\n const er = this[MKDIR](String(entry.absolute), mode)\n if (er) {\n this[ONERROR](er as Error, entry)\n done()\n return\n }\n if (entry.mtime && !this.noMtime) {\n try {\n fs.utimesSync(\n String(entry.absolute),\n entry.atime || new Date(),\n entry.mtime,\n )\n /* c8 ignore next */\n } catch (er) {}\n }\n if (this[DOCHOWN](entry)) {\n try {\n fs.chownSync(\n String(entry.absolute),\n Number(this[UID](entry)),\n Number(this[GID](entry)),\n )\n } catch (er) {}\n }\n done()\n entry.resume()\n }\n\n [MKDIR](dir: string, mode: number) {\n try {\n return mkdirSync(normalizeWindowsPath(dir), {\n uid: this.uid,\n gid: this.gid,\n processUid: this.processUid,\n processGid: this.processGid,\n umask: this.processUmask,\n preserve: this.preservePaths,\n unlink: this.unlink,\n cwd: this.cwd,\n mode: mode,\n })\n } catch (er) {\n return er\n }\n }\n\n [ENSURE_NO_SYMLINK](\n _entry: ReadEntry,\n cwd: string,\n parts: string[],\n done: () => void,\n onError: (er: SymlinkError) => void,\n ) {\n if (this.preservePaths || !parts.length) return done()\n let t = cwd\n for (const p of parts) {\n t = path.resolve(t, p)\n const [er, st] = callSync(() => fs.lstatSync(t))\n if (er) return done()\n if (st.isSymbolicLink()) {\n return onError(\n new SymlinkError(t, path.resolve(cwd, parts.join('/'))),\n )\n }\n }\n done()\n }\n\n [LINK](\n entry: ReadEntry,\n linkpath: string,\n link: 'link' | 'symlink',\n done: () => void,\n ) {\n const linkSync: `${typeof link}Sync` = `${link}Sync`\n try {\n fs[linkSync](linkpath, String(entry.absolute))\n done()\n entry.resume()\n } catch (er) {\n return this[ONERROR](er as Error, entry)\n }\n }\n}\n"]} \ No newline at end of file diff --git a/frontend-admin/node_modules/tar/package.json b/frontend-admin/node_modules/tar/package.json index 39776415..7565cf81 100644 --- a/frontend-admin/node_modules/tar/package.json +++ b/frontend-admin/node_modules/tar/package.json @@ -2,7 +2,7 @@ "author": "Isaac Z. Schlueter", "name": "tar", "description": "tar for node", - "version": "7.5.7", + "version": "7.5.9", "repository": { "type": "git", "url": "https://github.com/isaacs/node-tar.git" @@ -13,7 +13,7 @@ "test": "tap", "pretest": "npm run prepare", "presnap": "npm run prepare", - "prepare": "tshy", + "prepare": "tshy && bash scripts/build.sh", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", @@ -31,6 +31,7 @@ "@types/node": "^25.0.9", "chmodr": "^2.0.2", "end-of-stream": "^1.4.3", + "esbuild": "^0.27.3", "events-to-array": "^2.0.3", "mutate-fs": "^2.1.1", "nock": "^13.5.4", @@ -50,7 +51,17 @@ "tshy": { "exports": { "./package.json": "./package.json", - ".": "./src/index.ts", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + }, + "./raw": "./src/index.ts", "./c": "./src/create.ts", "./create": "./src/create.ts", "./replace": "./src/create.ts", @@ -74,6 +85,16 @@ "exports": { "./package.json": "./package.json", ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + }, + "./raw": { "import": { "types": "./dist/esm/index.d.ts", "default": "./dist/esm/index.js" @@ -265,7 +286,7 @@ } }, "type": "module", - "main": "./dist/commonjs/index.js", + "main": "./dist/commonjs/index.min.js", "types": "./dist/commonjs/index.d.ts", - "module": "./dist/esm/index.js" + "module": "./dist/esm/index.min.js" } diff --git a/frontend-admin/package-lock.json b/frontend-admin/package-lock.json index 2fca6368..50586946 100644 --- a/frontend-admin/package-lock.json +++ b/frontend-admin/package-lock.json @@ -14,7 +14,7 @@ "@react-navigation/native": "^7.1.28", "@react-navigation/native-stack": "^7.11.0", "axios": "^1.13.4", - "expo": "~54.0.32", + "expo": "~54.0.33", "expo-font": "~14.0.11", "expo-image-picker": "~17.0.10", "expo-location": "~19.0.8", @@ -29,7 +29,8 @@ "react-native-safe-area-context": "~5.6.0", "react-native-screens": "~4.16.0", "react-native-web": "^0.21.0", - "react-native-webview": "13.15.0" + "react-native-webview": "13.15.0", + "react-native-worklets": "0.5.1" }, "devDependencies": { "@expo/ngrok": "^4.1.3", @@ -1278,7 +1279,6 @@ "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.27.1.tgz", "integrity": "sha512-fBJKiV7F2DxZUkg5EtHKXQdbsbURW3DZKQUWphDum0uRP6eHGGa/He9mc0mypL680pb+e/lDIthRohlv8NCHkg==", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, @@ -1941,9 +1941,9 @@ } }, "node_modules/@expo/prebuild-config/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "bin": { "semver": "bin/semver.js" }, @@ -4022,12 +4022,12 @@ "integrity": "sha512-87OpwcEiMia/DeiKFzaQNBNFeN3XkkpYIh9FyOqq5mS2oKv3CBE67PXoEKcr6nodWdXNogTiQ0jE2NGuoffXPw==" }, "node_modules/expo": { - "version": "54.0.32", - "resolved": "https://registry.npmjs.org/expo/-/expo-54.0.32.tgz", - "integrity": "sha512-yL9eTxiQ/QKKggVDAWO5CLjUl6IS0lPYgEvC3QM4q4fxd6rs7ks3DnbXSGVU3KNFoY/7cRNYihvd0LKYP+MCXA==", + "version": "54.0.33", + "resolved": "https://registry.npmjs.org/expo/-/expo-54.0.33.tgz", + "integrity": "sha512-3yOEfAKqo+gqHcV8vKcnq0uA5zxlohnhA3fu4G43likN8ct5ZZ3LjAh9wDdKteEkoad3tFPvwxmXW711S5OHUw==", "dependencies": { "@babel/runtime": "^7.20.0", - "@expo/cli": "54.0.22", + "@expo/cli": "54.0.23", "@expo/config": "~12.0.13", "@expo/config-plugins": "~54.0.4", "@expo/devtools": "0.1.8", @@ -4205,9 +4205,9 @@ } }, "node_modules/expo/node_modules/@expo/cli": { - "version": "54.0.22", - "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-54.0.22.tgz", - "integrity": "sha512-BTH2FCczhJLfj1cpfcKrzhKnvRLTOztgW4bVloKDqH+G3ZSohWLRFNAIz56XtdjPxBbi2/qWhGBAkl7kBon/Jw==", + "version": "54.0.23", + "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-54.0.23.tgz", + "integrity": "sha512-km0h72SFfQCmVycH/JtPFTVy69w6Lx1cHNDmfLfQqgKFYeeHTjx7LVDP4POHCtNxFP2UeRazrygJhlh4zz498g==", "dependencies": { "@0no-co/graphql.web": "^1.0.8", "@expo/code-signing-certificates": "^0.0.6", @@ -4316,9 +4316,9 @@ } }, "node_modules/expo/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "bin": { "semver": "bin/semver.js" }, @@ -6248,9 +6248,9 @@ } }, "node_modules/npm-package-arg/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "bin": { "semver": "bin/semver.js" }, @@ -7040,120 +7040,32 @@ } }, "node_modules/react-native-worklets": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/react-native-worklets/-/react-native-worklets-0.7.2.tgz", - "integrity": "sha512-DuLu1kMV/Uyl9pQHp3hehAlThoLw7Yk2FwRTpzASOmI+cd4845FWn3m2bk9MnjUw8FBRIyhwLqYm2AJaXDXsog==", - "peer": true, + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/react-native-worklets/-/react-native-worklets-0.5.1.tgz", + "integrity": "sha512-lJG6Uk9YuojjEX/tQrCbcbmpdLCSFxDK1rJlkDhgqkVi1KZzG7cdcBFQRqyNOOzR9Y0CXNuldmtWTGOyM0k0+w==", "dependencies": { - "@babel/plugin-transform-arrow-functions": "7.27.1", - "@babel/plugin-transform-class-properties": "7.27.1", - "@babel/plugin-transform-classes": "7.28.4", - "@babel/plugin-transform-nullish-coalescing-operator": "7.27.1", - "@babel/plugin-transform-optional-chaining": "7.27.1", - "@babel/plugin-transform-shorthand-properties": "7.27.1", - "@babel/plugin-transform-template-literals": "7.27.1", - "@babel/plugin-transform-unicode-regex": "7.27.1", - "@babel/preset-typescript": "7.27.1", - "convert-source-map": "2.0.0", - "semver": "7.7.3" + "@babel/plugin-transform-arrow-functions": "^7.0.0-0", + "@babel/plugin-transform-class-properties": "^7.0.0-0", + "@babel/plugin-transform-classes": "^7.0.0-0", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.0.0-0", + "@babel/plugin-transform-optional-chaining": "^7.0.0-0", + "@babel/plugin-transform-shorthand-properties": "^7.0.0-0", + "@babel/plugin-transform-template-literals": "^7.0.0-0", + "@babel/plugin-transform-unicode-regex": "^7.0.0-0", + "@babel/preset-typescript": "^7.16.7", + "convert-source-map": "^2.0.0", + "semver": "7.7.2" }, "peerDependencies": { - "@babel/core": "*", + "@babel/core": "^7.0.0-0", "react": "*", "react-native": "*" } }, - "node_modules/react-native-worklets/node_modules/@babel/plugin-transform-class-properties": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.27.1.tgz", - "integrity": "sha512-D0VcalChDMtuRvJIu3U/fwWjf8ZMykz5iZsg77Nuj821vCKI3zCyRLwRdWbsuJ/uRwZhZ002QtCqIkwC/ZkvbA==", - "peer": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.27.1", - "@babel/helper-plugin-utils": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/react-native-worklets/node_modules/@babel/plugin-transform-classes": { - "version": "7.28.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.28.4.tgz", - "integrity": "sha512-cFOlhIYPBv/iBoc+KS3M6et2XPtbT2HiCRfBXWtfpc9OAyostldxIf9YAYB6ypURBBbx+Qv6nyrLzASfJe+hBA==", - "peer": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.27.3", - "@babel/helper-compilation-targets": "^7.27.2", - "@babel/helper-globals": "^7.28.0", - "@babel/helper-plugin-utils": "^7.27.1", - "@babel/helper-replace-supers": "^7.27.1", - "@babel/traverse": "^7.28.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/react-native-worklets/node_modules/@babel/plugin-transform-nullish-coalescing-operator": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.27.1.tgz", - "integrity": "sha512-aGZh6xMo6q9vq1JGcw58lZ1Z0+i0xB2x0XaauNIUXd6O1xXc3RwoWEBlsTQrY4KQ9Jf0s5rgD6SiNkaUdJegTA==", - "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/react-native-worklets/node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.27.1.tgz", - "integrity": "sha512-BQmKPPIuc8EkZgNKsv0X4bPmOoayeu4F1YCwx2/CfmDSXDbp7GnzlUH+/ul5VGfRg1AoFPsrIThlEBj2xb4CAg==", - "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1", - "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/react-native-worklets/node_modules/@babel/preset-typescript": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.27.1.tgz", - "integrity": "sha512-l7WfQfX0WK4M0v2RudjuQK4u99BS6yLHYEmdtVPP7lKV013zr9DygFuWNlnbvQ9LR+LS0Egz/XAvGx5U9MX0fQ==", - "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1", - "@babel/helper-validator-option": "^7.27.1", - "@babel/plugin-syntax-jsx": "^7.27.1", - "@babel/plugin-transform-modules-commonjs": "^7.27.1", - "@babel/plugin-transform-typescript": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/react-native-worklets/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", - "peer": true, + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", "bin": { "semver": "bin/semver.js" }, @@ -7920,9 +7832,9 @@ } }, "node_modules/tar": { - "version": "7.5.7", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.7.tgz", - "integrity": "sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==", + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.9.tgz", + "integrity": "sha512-BTLcK0xsDh2+PUe9F6c2TlRp4zOOBMTkoQHQIWSIzI0R7KG46uEwq4OPk2W7bZcprBMsuaeFsqwYr7pjh6CuHg==", "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", diff --git a/frontend-admin/package.json b/frontend-admin/package.json index 7fe56d55..f833be62 100644 --- a/frontend-admin/package.json +++ b/frontend-admin/package.json @@ -15,7 +15,7 @@ "@react-navigation/native": "^7.1.28", "@react-navigation/native-stack": "^7.11.0", "axios": "^1.13.4", - "expo": "~54.0.32", + "expo": "~54.0.33", "expo-font": "~14.0.11", "expo-image-picker": "~17.0.10", "expo-location": "~19.0.8", @@ -30,7 +30,8 @@ "react-native-safe-area-context": "~5.6.0", "react-native-screens": "~4.16.0", "react-native-web": "^0.21.0", - "react-native-webview": "13.15.0" + "react-native-webview": "13.15.0", + "react-native-worklets": "0.5.1" }, "devDependencies": { "@expo/ngrok": "^4.1.3", diff --git a/mobile/src/api/api.ts b/mobile/src/api/api.ts index 1a03aa54..6a296cb2 100644 --- a/mobile/src/api/api.ts +++ b/mobile/src/api/api.ts @@ -11,7 +11,7 @@ import type { import { getToken } from "../auth/tokenStorage"; import { extractUsernameFromToken } from "../auth/jwtUtils"; -const V1 = "http://172.20.167.237:8080/api/v1"; +const V1 = "https://uber-stup.club/api/v1"; // ============================================ // AUTH HELPERS diff --git a/mobile/src/api/client.ts b/mobile/src/api/client.ts index 4c1b34a9..d75a799d 100644 --- a/mobile/src/api/client.ts +++ b/mobile/src/api/client.ts @@ -2,7 +2,7 @@ import axios from "axios"; import { getToken, getAdminToken } from "../auth/tokenStorage"; // Change this to your server IP/domain -export const API_BASE_URL = "http://172.20.167.237:8080"; +export const API_BASE_URL = "https://uber-stup.club"; const apiClient = axios.create({ baseURL: API_BASE_URL, diff --git a/mobile/src/services/pushNotifications.ts b/mobile/src/services/pushNotifications.ts index e5b59952..873ef0fa 100644 --- a/mobile/src/services/pushNotifications.ts +++ b/mobile/src/services/pushNotifications.ts @@ -4,7 +4,7 @@ import Constants from "expo-constants"; import { Platform } from "react-native"; import apiClient from "../api/client"; -const V1 = "http://172.20.167.237:8080/api/v1"; +const V1 = "https://uber-stup.club/api/v1"; // Configuration du comportement des notifications en foreground Notifications.setNotificationHandler({ @@ -64,9 +64,7 @@ export async function registerForPushNotificationsAsync(): Promise< Constants.easConfig?.projectId; if (!projectId) { - console.log( - "⚠️ projectId non trouvé - push notifications désactivées", - ); + console.log("⚠️ projectId non trouvé - push notifications désactivées"); return null; }