Migration datamodels !

This commit is contained in:
2026-01-09 17:11:12 +01:00
parent 901df5b395
commit 66fe1418f0
3922 changed files with 316803 additions and 2103 deletions

87
CHAT_MESSAGES_V2.md Normal file
View File

@@ -0,0 +1,87 @@
# Amélioration des Messages de Chat - Mournblade
## Vue d'ensemble
Les messages de chat pour les résultats de jets de dés et de dégâts ont été entièrement remaniés pour offrir une présentation moderne et professionnelle, inspirée du système Hawkmoon mais avec la palette de couleurs distinctive de Mournblade.
## Fichiers créés
### Templates
- `templates/chat-generic-result-v2.hbs` - Template pour les jets génériques (compétences, attributs, armes, runes)
- `templates/chat-degats-result-v2.hbs` - Template pour les jets de dégâts
### Style
- Nouveau CSS dans `less/simple-converted.less` (classe `.mournblade-chat-result`)
### Fichiers modifiés
- `modules/mournblade-utility.js` - Mis à jour pour utiliser les nouvelles templates v2
- `modules/mournblade-actor.js` - Mis à jour pour utiliser les nouvelles templates v2
## Caractéristiques
### Structure visuelle améliorée
1. **Header élégant**
- Portrait de l'acteur avec bordure
- Nom de l'acteur en couleur claire
- Titre de l'action en doré avec icône
2. **Résultat principal**
- Affichage visuel du résultat du dé
- Total calculé bien visible
- Seuil de difficulté (SD) affiché clairement
- Badge de résultat coloré (Héroïque, Succès, Échec, Dramatique)
3. **Détails organisés**
- Lignes de détails avec fond alterné
- Formule de dé
- Attributs et compétences utilisés
- Bonus/malus mis en évidence avec couleur distinctive
4. **Effets et conséquences**
- Zone dédiée pour les effets spéciaux (assommer, immobiliser, etc.)
- Boutons d'action (lancer dégâts, appliquer dégâts)
- Avertissements pour les situations défavorables
5. **Prédilections**
- Boutons pour utiliser les prédilections non utilisées
- Couleur violette distinctive
### Palette de couleurs Mournblade
- **Rouge sombre** (#8b0000, #4a0404) : Couleurs principales, bordures
- **Doré** (#ffd700) : Accents, titres d'action
- **Violet** (#4b0082) : Prédilections, runes
- **Dégradés** : Utilisés pour les badges et boutons
- Héroïque : Or à orange (#ffd700#ff8c00)
- Succès : Vert (#4caf50#2e7d32)
- Échec : Rouge sombre (#8b0000#4a0404)
- Dramatique : Violet profond (#4b0082#2d004d)
### Badges de résultat
Les badges sont affichés de manière proéminente avec icônes :
-**HÉROÏQUE !** - Gradient doré/orange
-**Succès** - Gradient vert
-**Échec** - Gradient rouge sombre
- 💀 **DRAMATIQUE !** - Gradient violet
### Boutons interactifs
Tous les boutons utilisent le style Mournblade :
- Fond en dégradé rouge sombre
- Bordure rouge
- Effet hover avec élévation
- Icônes Font Awesome pour clarté visuelle
## Compatibilité
Les anciennes templates sont conservées (`chat-generic-result.hbs`, `chat-degats-result.hbs`) mais ne sont plus utilisées. Elles peuvent être supprimées si nécessaire.
## Notes techniques
- Utilise la police CentaurMT pour cohérence avec le reste du système
- Effets de transparence et dégradés pour profondeur visuelle
- Responsive et s'adapte à différentes largeurs
- Compatible avec le système de prédilections existant
- Gère tous les types d'attaques spéciales (assommer, immobiliser, fuir, etc.)

35
gulpfile.js Normal file
View File

@@ -0,0 +1,35 @@
const gulp = require('gulp');
const less = require('gulp-less');
const sourcemaps = require('gulp-sourcemaps');
// Paths
const paths = {
styles: {
src: 'less/**/*.less',
dest: 'styles/'
}
};
// Compile LESS to CSS
function styles() {
return gulp.src('less/mournblade.less')
.pipe(sourcemaps.init())
.pipe(less())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(paths.styles.dest));
}
// Watch files
function watchFiles() {
gulp.watch(paths.styles.src, styles);
}
// Define complex tasks
const build = gulp.series(styles);
const watch = gulp.series(build, watchFiles);
// Export tasks
exports.styles = styles;
exports.build = build;
exports.watch = watch;
exports.default = build;

View File

@@ -141,7 +141,7 @@
"MNBL.hair": "Cheveux",
"MNBL.eyes": "Yeux",
"MNBL.preferredhand": "Main Préférée",
"MNBL.weight": "Weight",
"MNBL.weight": "Poids",
"MNBL.soulmultiplier": "Multiplicateur d'âme",
"MNBL.ignorehealthmalus": "Ignore le malus de santé",
"MNBL.ignoresoulmalus": "Ignore le malus d'âme",
@@ -214,6 +214,11 @@
"MNBL.attribute": "Attribut",
"MNBL.Protections": "Protections",
"MNBL.rune": "Rune",
"MNBL.total": "Total"
"MNBL.total": "Total",
"MNBL.description": "Description",
"MNBL.details": "Détails",
"MNBL.sacrifice": "Sacrifice",
"MNBL.identity": "Identité",
"MNBL.gmtools": "Outils MJ"
}

874
less/actor-styles.less Normal file
View File

@@ -0,0 +1,874 @@
/* ==================== Actor Sheet Styles ==================== */
// NOTE: Ce fichier surcharge certaines règles de simple-converted.less
// Les sélecteurs .fvtt-mournblade.actor sont plus spécifiques et prennent priorité
.fvtt-mournblade.actor {
// Background pour toute la fiche d'acteur
background: url("../assets/ui/pc_sheet_bg.webp") repeat;
// AppV2 - Structure flex pour permettre le scroll
.window-content {
height: 100%;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
// Main form structure
form,
.sheet-form-layout {
height: 100%;
background: url("../assets/ui/pc_sheet_bg.webp") repeat-y;
color: black;
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
overflow: hidden;
padding: 0;
margin: 0;
// La section racine du template (if nested inside form, or simple direct children handling)
> section {
height: 100%;
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
overflow: hidden;
}
}
// SURCHARGE: simple-converted.less définit flex: 0 0 210px
.sheet-header {
background: url("../assets/ui/pc_sheet_bg.webp") repeat;
padding: 0.5rem;
margin: 0;
flex: 0 0 auto !important; // Override simple-converted
overflow: visible !important; // Override simple-converted
.background-sheet-header {
background: transparent;
}
.header-main-content {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.header-stats-grid {
display: grid;
grid-template-columns: 2fr 1fr 1fr;
gap: 0.75rem;
padding: 0.5rem;
background: rgba(0, 0, 0, 0.15);
border: 2px solid rgba(139, 69, 19, 0.5);
border-radius: 4px;
}
.stat-group {
display: flex;
flex-direction: column;
gap: 0.3rem;
padding: 0.35rem 0.6rem;
background: rgba(0, 0, 0, 0.2);
border: 1px solid rgba(139, 69, 19, 0.4);
border-radius: 3px;
&.stat-group-health {
border-left: 3px solid rgba(200, 0, 0, 0.6);
background: rgba(40, 0, 0, 0.15);
}
}
.stat-title {
font-size: 0.75rem;
font-weight: bold;
color: #f5e6d3;
margin: 0;
padding: 0 0 0.3rem 0;
border-bottom: 1px solid rgba(139, 69, 19, 0.5);
text-transform: uppercase;
letter-spacing: 0.5px;
font-family: "CentaurMT", serif;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}
.stat-values {
display: flex;
flex-direction: row;
gap: 0.5rem;
flex-wrap: wrap;
justify-content: center;
}
.stat-item {
display: flex;
flex-direction: column;
gap: 0.2rem;
align-items: center;
flex: 1;
min-width: 0;
}
.stat-label {
font-size: 0.7rem;
color: #d4c5b0;
margin: 0;
font-weight: 600;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
}
.stat-value {
font-size: 0.85rem;
font-weight: bold;
color: #fff;
padding: 0.25rem 0.5rem;
background: rgba(0, 0, 0, 0.4);
border: 1px solid rgba(139, 69, 19, 0.6);
border-radius: 3px;
min-width: 2.5rem;
text-align: center;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
width: 100%;
}
.stat-input {
font-size: 0.8rem;
font-weight: 600;
padding: 0.25rem 0.4rem;
background: rgba(40, 30, 20, 0.7);
border: 1px solid rgba(139, 69, 19, 0.7);
color: #fff;
border-radius: 3px;
text-align: center;
min-width: 2.5rem;
max-width: 100%;
width: 100%;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
&.stat-input-single {
min-width: 3.5rem;
}
&.stat-input-damage {
border-color: rgba(200, 0, 0, 0.8);
background: rgba(80, 0, 0, 0.5);
}
&:hover {
background: rgba(60, 45, 30, 0.8);
border-color: rgba(255, 102, 0, 0.6);
}
&:focus {
outline: none;
border-color: rgba(255, 102, 0, 1);
box-shadow: 0 0 6px rgba(255, 102, 0, 0.5), inset 0 1px 3px rgba(0, 0, 0, 0.3);
background: rgba(70, 50, 35, 0.9);
}
}
.header-fields {
h4.item-name-label.competence-name {
font-size: 0.75rem;
padding-top: 3px;
}
.item-name-label.competence-name {
font-size: 0.75rem;
}
label.item-name-label.competence-name {
font-size: 0.7rem;
}
.item-field-label-short {
font-size: 0.8rem;
}
.status-small-label {
font-size: 0.8rem;
}
}
}
// Sheet navigation tabs
// SURCHARGE: simple-converted.less définit flex: 0
.sheet-tabs {
margin: 0;
padding: 0 0.5rem;
flex: 0 0 auto !important; // Override simple-converted
}
// Sheet body - section scrollable
// SURCHARGE CRITIQUE: simple-converted.less définit height: auto sur .sheet-body et .tab
// Ces surcharges permettent le scroll vertical
.sheet-body {
margin: 0;
padding: 0.5rem;
flex: 1 !important; // Override simple-converted
min-height: 0 !important; // Critique pour le scroll
overflow-y: auto !important; // Override simple-converted
.tab {
padding: 0;
height: auto !important; // Override simple-converted qui met height: auto
&:not(.active) {
display: none;
}
// Assurer que les grilles peuvent scroller
.grid, .grid-2col {
height: auto;
overflow: visible;
}
.sheet-box {
height: auto;
}
}
// Listes compactes dans les sections
.compact-list {
list-style: none;
margin: 0;
padding: 0;
li.item {
padding: 0.2rem 0.4rem;
margin-bottom: 0.15rem;
background: rgba(0, 0, 0, 0.1);
border: 1px solid rgba(139, 69, 19, 0.3);
border-radius: 3px;
&:hover {
background: rgba(0, 0, 0, 0.15);
}
&.items-title-bg {
background: rgba(0, 0, 0, 0.3);
border-color: rgba(139, 69, 19, 0.5);
font-weight: 600;
margin-bottom: 0.3rem;
.item-name-label-header {
color: #f5e6d3;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
}
}
}
}
// Contrôles d'items (edit, delete, equip, etc.)
.item-controls {
display: flex;
align-items: center;
gap: 0.3rem;
justify-content: flex-end;
.item-control {
display: inline-flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
color: #5a3a1a;
text-decoration: none;
cursor: pointer;
border-radius: 3px;
transition: all 0.2s;
&:hover {
color: #2a1a0a;
background: rgba(139, 69, 19, 0.2);
transform: scale(1.1);
}
i {
font-size: 0.85rem;
}
&.item-edit {
color: #4a7c59;
&:hover {
color: #2d5a3a;
background: rgba(74, 124, 89, 0.2);
}
}
&.item-delete {
color: #a04040;
&:hover {
color: #802020;
background: rgba(160, 64, 64, 0.2);
}
}
&.item-equip {
color: #6b5b3a;
&:hover {
color: #4a3a1a;
background: rgba(107, 91, 58, 0.2);
}
i.fa-circle {
color: #4a7c59;
}
i.fa-genderless {
color: #8a6a4a;
}
}
&.item-add {
color: #4a7c59;
&:hover {
color: #2d5a3a;
background: rgba(74, 124, 89, 0.2);
}
}
}
}
.item-controls-fixed {
min-width: 3.2rem;
max-width: 3.2rem;
}
// Couleurs pour les labels et textes dans les onglets
h4, h3, label, span.item-name-label, span.competence-name,
.label-name, .generic-label, .item-field-label-short,
.item-field-label-medium, .item-field-label-long,
.short-label, .items-title-text {
color: #3a2a1a !important;
text-shadow: 0px 0px 1px rgba(255, 255, 255, 0.3);
}
// Inputs dans le corps
input[type="text"], input[type="number"], select {
color: #2a1a0a;
background: rgba(255, 250, 240, 0.8);
border: 1px solid rgba(139, 69, 19, 0.5);
height: 24px;
padding: 0.15rem 0.3rem;
line-height: 1.2;
&:focus {
background: rgba(255, 255, 245, 0.95);
border-color: rgba(139, 69, 19, 0.8);
}
}
// Titres de sections
h3, h4 {
font-weight: bold;
color: #2a1a0a !important;
}
// Titres de sections Santé, Âme, Combat
h4.item-name-label.competence-name {
font-size: 0.85rem;
margin-top: 0.2rem;
margin-bottom: 0.3rem;
padding-top: 0;
}
// Section grids pour Santé, Âme, Combat
.section-grid {
display: flex;
flex-direction: column;
gap: 0.2rem;
padding: 0.3rem 0.4rem;
margin-bottom: 0.3rem;
background: rgba(0, 0, 0, 0.15);
border: 2px solid rgba(139, 69, 19, 0.5);
border-radius: 4px;
.section-title {
font-size: 0.85rem;
font-weight: bold;
color: #f5e6d3;
text-transform: uppercase;
letter-spacing: 0.5px;
margin: 0 0 0.2rem 0;
padding: 0.2rem 0.4rem;
background: rgba(0, 0, 0, 0.3);
border-left: 3px solid rgba(139, 69, 19, 0.8);
border-radius: 2px;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
}
.grid-row {
display: grid;
grid-template-columns: 1fr 1fr;
align-items: center;
gap: 0.4rem;
padding: 0.25rem 0.4rem;
background: rgba(0, 0, 0, 0.2);
border: 1px solid rgba(139, 69, 19, 0.4);
border-radius: 3px;
input {
width: 60px;
min-width: 60px;
}
&.attr-row {
grid-template-columns: 40px 1fr auto;
gap: 0.5rem;
.item-name-img {
width: 32px;
height: 32px;
border-radius: 3px;
border: 1px solid rgba(139, 69, 19, 0.5);
}
.label-name {
display: flex;
align-items: center;
a {
color: #f5e6d3;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
font-weight: 600;
cursor: pointer;
&:hover {
color: #fff;
text-shadow: 0 0 4px rgba(255, 200, 100, 0.8);
}
}
}
select {
width: 80px;
}
}
.label-name {
font-weight: 600;
font-size: 0.9rem;
color: #d4c5b0;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
}
.stat-label {
font-weight: 600;
font-size: 0.9rem;
color: #d4c5b0;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
}
.value-display {
text-align: center;
font-weight: bold;
font-size: 1rem;
color: #fff;
background: rgba(0, 0, 0, 0.4);
padding: 0.2rem 0.4rem;
border-radius: 3px;
border: 1px solid rgba(139, 69, 19, 0.6);
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
}
.malus-value {
text-align: center;
font-weight: bold;
font-size: 1rem;
color: #ff9999;
background: rgba(0, 0, 0, 0.4);
padding: 0.2rem 0.4rem;
border-radius: 3px;
border: 1px solid rgba(200, 50, 50, 0.6);
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
}
&.damage-row {
grid-template-columns: 120px 1fr;
.damage-label {
font-size: 0.95rem;
font-weight: 600;
}
.damage-controls {
display: flex;
align-items: center;
justify-content: center;
gap: 0.4rem;
input {
width: 60px;
min-width: 60px;
flex-shrink: 0;
text-align: center;
font-size: 1.1rem;
font-weight: bold;
}
.plus-minus-button {
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.2rem;
font-weight: bold;
border-radius: 4px;
border: 2px solid rgba(139, 69, 19, 0.5);
background: linear-gradient(to bottom, rgba(210, 180, 140, 0.9), rgba(180, 150, 110, 0.9));
color: #2a1a0a;
cursor: pointer;
transition: all 0.15s;
&:hover {
background: linear-gradient(to bottom, rgba(230, 200, 160, 0.95), rgba(200, 170, 130, 0.95));
border-color: rgba(139, 69, 19, 0.8);
transform: scale(1.08);
}
&:active {
transform: scale(0.95);
}
}
}
}
&.soul-consumed-row {
grid-template-columns: 120px 1fr;
}
&.soul-malus-row {
grid-template-columns: 90px 1fr;
gap: 0.4rem;
.label-name {
font-size: 0.85rem;
}
.malus-value {
font-size: 0.9rem;
padding: 0.2rem 0.3rem;
}
}
&.malus-row {
grid-template-columns: 55px 60px 75px 50px;
gap: 0.3rem;
.label-name {
font-size: 0.85rem;
}
input {
width: 100%;
min-width: unset;
}
.malus-value {
font-size: 0.9rem;
padding: 0.2rem 0.3rem;
}
}
}
&.combat-grid {
.grid-row.combat-stat {
grid-template-columns: 85px 50px 60px 55px;
gap: 0.4rem;
.stat-label {
font-size: 0.85rem;
}
.stat-base {
text-align: center;
font-weight: bold;
font-size: 0.85rem;
color: #fff;
background: rgba(0, 0, 0, 0.4);
padding: 0.2rem 0.3rem;
border-radius: 3px;
border: 1px solid rgba(139, 69, 19, 0.6);
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
}
input {
width: 50px;
min-width: 50px;
text-align: center;
}
.stat-total {
text-align: center;
font-weight: bold;
font-size: 0.85rem;
color: #fff;
background: rgba(0, 0, 0, 0.4);
padding: 0.2rem 0.3rem;
border-radius: 3px;
border: 1px solid rgba(139, 69, 19, 0.6);
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
}
}
.grid-row.protection-row {
grid-template-columns: 1fr 1fr;
.protection-value {
text-align: center;
font-weight: bold;
font-size: 1.2rem;
color: #fff;
background: rgba(0, 0, 0, 0.4);
padding: 0.25rem 0.4rem;
border-radius: 3px;
border: 1px solid rgba(139, 69, 19, 0.6);
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
}
}
}
}
// Boutons d'actions spéciales
.action-buttons {
display: flex;
flex-direction: column;
gap: 0.3rem;
padding: 0.3rem 0;
button {
margin: 0;
}
}
.action-buttons-row {
display: flex;
flex-direction: row;
align-items: center;
gap: 0.5rem;
padding: 0.3rem 0;
button {
margin: 0;
flex: 1;
}
.mounted-checkbox {
display: flex;
align-items: center;
gap: 0.4rem;
padding: 0.3rem 0.6rem;
white-space: nowrap;
label {
margin: 0;
font-size: 0.9rem;
}
input[type="checkbox"] {
margin: 0;
cursor: pointer;
}
}
}
}
}
/* ==================== Creature Sheet Specific Styles ==================== */
.fvtt-mournblade.actor.creature-sheet {
// Variant background pour creatures - teinte légèrement différente
.background-sheet-header-creature {
background: linear-gradient(135deg, rgba(0, 60, 0, 0.15) 0%, rgba(20, 80, 20, 0.1) 100%);
border: 2px solid rgba(34, 139, 34, 0.5);
border-radius: 4px;
padding: 0;
}
// Légère teinte verte pour les sections
.sheet-box {
&.color-bg-archetype {
background: linear-gradient(135deg, rgba(0, 40, 0, 0.08) 0%, rgba(20, 60, 20, 0.05) 100%);
}
}
// Header simplifié pour creatures
.sheet-header {
flex: 0 0 auto !important;
padding: 0;
}
.profile-img {
width: 80px;
height: 80px;
border-radius: 8px;
border: 2px solid rgba(34, 139, 34, 0.6);
object-fit: cover;
cursor: pointer;
flex-shrink: 0;
}
// Tabs avec teinte verte
nav.tabs {
.item.active {
border-bottom-color: rgba(34, 139, 34, 0.8);
color: #228b22;
}
}
// Section titles avec teinte verte
.section-title {
color: #1a5a1a;
border-bottom-color: rgba(34, 139, 34, 0.3);
}
// Items headers
.items-title-bg {
background: linear-gradient(135deg, rgba(0, 60, 0, 0.15) 0%, rgba(20, 80, 20, 0.1) 100%);
border-bottom: 1px solid rgba(34, 139, 34, 0.3);
}
}
// PNJ Sheet - Orange/Copper theme for visual distinction
.fvtt-mournblade.actor.pnj-sheet {
// Variant background pour PNJs - teinte orange/cuivre
.background-sheet-header-creature {
background: linear-gradient(135deg, rgba(80, 40, 0, 0.15) 0%, rgba(100, 50, 0, 0.1) 100%);
border: 2px solid rgba(205, 127, 50, 0.5);
border-radius: 4px;
padding: 0;
}
// Légère teinte orange/cuivre pour les sections
.sheet-box {
&.color-bg-archetype {
background: linear-gradient(135deg, rgba(60, 30, 0, 0.08) 0%, rgba(80, 40, 0, 0.05) 100%);
}
}
// Header simplifié pour PNJs
.sheet-header {
flex: 0 0 auto !important;
padding: 0;
}
.profile-img {
width: 80px;
height: 80px;
border-radius: 8px;
border: 2px solid rgba(205, 127, 50, 0.6);
object-fit: cover;
cursor: pointer;
flex-shrink: 0;
}
// Tabs avec teinte orange/cuivre
nav.tabs {
.item.active {
border-bottom-color: rgba(205, 127, 50, 0.8);
color: #cd7f32;
}
}
// Section titles avec teinte orange/cuivre
.section-title {
color: #b8734d;
border-bottom-color: rgba(205, 127, 50, 0.3);
}
// Items headers
.items-title-bg {
background: linear-gradient(135deg, rgba(80, 40, 0, 0.15) 0%, rgba(100, 50, 0, 0.1) 100%);
border-bottom: 1px solid rgba(205, 127, 50, 0.3);
}
}
// GM Tools section - labels plus larges
.gm-tools-section {
.grid {
.item-list .flexrow.item {
.label-name {
flex: 1;
min-width: 12rem;
}
}
}
}
// Alignment group in header
.stat-group-alignment {
.stat-values.alignment-values {
display: flex;
flex-direction: column;
gap: 0.3rem;
}
.alignment-row {
display: flex;
align-items: center;
gap: 0.3rem;
.alignment-label {
font-weight: bold;
min-width: 4rem;
font-size: 0.85rem;
}
.alignment-inputs {
display: flex;
align-items: center;
gap: 0.2rem;
flex: 1;
}
.stat-label-mini {
font-size: 0.7rem;
min-width: 2.5rem;
}
.stat-input-mini {
width: 2.5rem;
height: 1.5rem;
padding: 0.1rem 0.2rem;
font-size: 0.8rem;
}
select.stat-input-mini {
width: 3rem;
}
}
.alignment-info {
display: flex;
justify-content: space-around;
margin-top: 0.2rem;
padding-top: 0.2rem;
border-top: 1px solid rgba(139, 69, 19, 0.3);
.info-label {
font-size: 0.75rem;
color: #f5e6d3;
strong {
color: #ffd700;
}
}
}
}

299
less/item-styles.less Normal file
View File

@@ -0,0 +1,299 @@
/* ==================== Item Sheet Styles ==================== */
/* Item header with image and name */
.fvtt-mournblade.item {
/* Background pour toute la fiche d'item */
background: url("../assets/ui/pc_sheet_bg.webp") repeat;
display: flex;
flex-direction: column;
height: 100%;
padding: 0;
margin: 0;
/* AppV2 - Remove window content padding */
.window-content {
padding: 0;
margin: 0;
}
/* AppV2 - Main section structure */
section {
background: url("../assets/ui/pc_sheet_bg.webp") repeat-y;
color: black;
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
padding: 0;
margin: 0;
}
/* AppV2 Item Sheets - Disabled inputs readability */
input:disabled,
select:disabled {
color: #000000;
opacity: 0.8;
background-color: rgba(255, 255, 255, 0.5);
}
/* Inputs and selects styling */
input[type="text"],
input[type="number"],
select {
color: #000000;
background-color: rgba(255, 255, 255, 0.7);
border: 1px solid #999999;
margin: 0;
padding: 2px 4px;
font-family: "CentaurMT", serif;
font-size: 0.85rem;
}
textarea {
margin: 0;
padding: 2px 4px;
}
input[type="checkbox"] {
width: auto;
height: auto;
margin: 0 4px;
align-self: center;
}
.header {
flex: 0 0 auto;
border-bottom: 1px solid #999;
margin: 0;
}
.sheet-header {
display: flex;
flex-direction: row;
align-items: center;
gap: 1rem;
padding: 0.5rem;
background: url("../assets/ui/pc_sheet_bg.webp") repeat;
flex: 0 0 auto;
}
.item-sheet-img {
flex: 0 0 64px;
width: 64px;
height: 64px;
object-fit: cover;
border: 1px solid #999;
border-radius: 4px;
cursor: pointer;
&:hover {
box-shadow: 0 0 8px rgba(255, 102, 0, 0.8);
}
}
.header-fields {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.header-actions {
flex: 0 0 auto;
display: flex;
align-items: center;
gap: 0.5rem;
button {
background: rgba(0, 0, 0, 0.1);
border: 1px solid #999;
padding: 0.25rem 0.5rem;
cursor: pointer;
font-family: "CentaurMT", serif;
&:hover {
background: rgba(255, 102, 0, 0.2);
box-shadow: 0 0 5px rgba(255, 102, 0, 0.5);
}
}
.chat-card-button {
background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%);
border: 2px ridge #846109;
color: #d4b5a8;
padding: 0.3rem 0.5rem;
transition: all 0.2s ease;
i {
font-size: 0.9rem;
}
&:hover {
background: linear-gradient(to bottom, #800000 5%, #3e0101 100%);
color: #ffffff;
box-shadow: 0 0 8px rgba(128, 0, 0, 0.6);
}
&:active {
position: relative;
top: 1px;
}
}
}
.sheet-header h1.charname {
height: 50px;
padding: 0;
margin: 5px 0;
border-bottom: 0;
font-weight: bold;
font-size: 2rem;
font-family: "CentaurMT";
}
.sheet-header h1.charname input {
width: 100%;
height: 100%;
margin: 0;
font-weight: bold;
font-family: "CentaurMT";
font-size: 2rem;
text-align: left;
border: 0 none;
&:focus {
outline: 1px solid #ff6600;
}
}
/* Tabs - Modern style matching actor sheets */
nav.tabs {
display: flex;
border-bottom: 1px solid #7a7971;
margin: 0;
padding: 4px;
background-color: #1c1c1c;
flex: 0 0 auto;
}
nav.tabs a.item {
padding: 6px 12px;
color: #d4af37;
text-decoration: none;
border: 1px solid transparent;
border-radius: 4px 4px 0 0;
margin-right: 4px;
transition: all 0.2s;
i {
display: none; // Hide icons to match actor sheets
}
&:hover {
background-color: rgba(212, 175, 55, 0.1);
}
&.active {
background-color: #2a2a2a;
border-bottom-color: #d4af37;
color: #f5f5f5;
}
}
/* Tab content */
.tab {
display: none;
padding: 4px 8px;
overflow-y: auto;
flex: 1 1 auto;
&.active {
display: block;
}
}
/* Item list in details tab */
.item-list {
list-style: none;
margin: 0;
padding: 0;
li.item {
display: flex;
align-items: center;
margin-bottom: 2px;
padding: 2px 4px;
min-height: 24px;
border-bottom: none;
&.flexrow {
display: flex;
flex-direction: row;
align-items: center;
gap: 4px;
}
}
}
/* Labels */
.generic-label {
display: inline-block;
white-space: nowrap;
font-weight: 700;
color: #464331c4;
font-size: 0.9rem;
font-family: "CentaurMT", serif;
margin: 0;
padding: 0 4px 0 0;
}
/* Field labels */
.item-field-label-short {
flex: 0 0 60px;
max-width: 60px;
}
.item-field-label-medium {
flex: 0 0 100px;
max-width: 100px;
}
.item-field-label-long {
flex: 1;
min-width: 150px;
}
.item-field-label-long1 {
flex: 1;
min-width: 200px;
}
.item-field-label-long2 {
flex: 1;
min-width: 250px;
max-width: 250px;
}
.item-field-label-long3 {
flex: 1;
min-width: 350px;
max-width: 350px;
}
.numeric-input {
text-align: center;
width: 60px;
}
/* Editor fields */
.editor {
height: 300px;
border: 1px solid #999;
background: rgba(255, 255, 255, 0.9);
.editor-content {
height: 100%;
padding: 0.5rem;
color: #000;
}
}
}

6
less/mournblade.less Normal file
View File

@@ -0,0 +1,6 @@
// Main LESS file for Mournblade system
// Importing base styles and component-specific styles
@import "simple-converted";
@import "item-styles";
@import "actor-styles";

View File

@@ -65,21 +65,6 @@
letter-spacing: 1px;
}
* {
scrollbar-color: initial;
}
::-webkit-scrollbar-thumb {
border-color: #ff6400;
}
@-moz-document url-prefix() {
* {
scrollbar-color: #782e22 transparent;
scrollbar-width: thin;
}
}
/* Fonts */
.sheet header.sheet-header h1 input,
.window-app .window-header,
@@ -135,12 +120,11 @@
cursor: pointer;
}
input:disabled {
color: #1c2058;
}
input:disabled,
select:disabled {
color: #1c2058;
opacity: 1;
cursor: not-allowed;
-webkit-text-fill-color: currentColor;
}
table {
@@ -354,7 +338,11 @@
}
.fvtt-mournblade .sheet-body,
.fvtt-mournblade .sheet-body .tab,
.fvtt-mournblade .sheet-body .tab {
height: auto;
font-size: 0.9rem;
}
.fvtt-mournblade .sheet-body .tab .editor {
height: 100%;
font-size: 0.9rem;
@@ -1312,7 +1300,7 @@
text-shadow: 0px 1px 0px #4d3534;
position: relative;
max-height: 1.8rem;
max-width: 4rem;
width: 3.5rem;
margin-left: 4px;
}
@@ -1331,7 +1319,7 @@
text-shadow: 0px 1px 0px #4d3534;
position: relative;
max-height: 1.8rem;
max-width: 4rem;
width: 3.5rem;
margin-left: 4px;
}
@@ -1565,4 +1553,924 @@
.item-controls-fixed {
min-width: 3.2rem;
max-width: 3.2rem;
}
}
/* Item Sheet Header Actions */
.header-actions {
display: flex;
align-items: center;
gap: 8px;
margin-left: auto;
}
.chat-card-button {
background: none;
border: none;
cursor: pointer;
padding: 4px 8px;
border-radius: 4px;
transition: background-color 0.2s;
color: #d4af37;
font-size: 1rem;
}
.chat-card-button:hover {
background-color: rgba(212, 175, 55, 0.2);
color: #f5f5f5;
}
.chat-card-button i {
margin-right: 4px;
}
/* Item Sheet Navigation Tabs */
.sheet-tabs.tabs {
display: flex;
border-bottom: 1px solid #7a7971;
margin-bottom: 10px;
background-color: #1c1c1c;
padding: 4px;
}
.sheet-tabs.tabs .item {
padding: 6px 12px;
color: #d4af37;
text-decoration: none;
border: 1px solid transparent;
border-radius: 4px 4px 0 0;
margin-right: 4px;
transition: all 0.2s;
}
.sheet-tabs.tabs .item:hover {
background-color: rgba(212, 175, 55, 0.1);
}
.sheet-tabs.tabs .item.active {
background-color: #2a2a2a;
border-bottom-color: #d4af37;
color: #f5f5f5;
}
.sheet-tabs.tabs .item i {
margin-right: 6px;
}
/* ==================== Roll Dialog V2 Styles ==================== */
.application.mournblade-roll-dialog .window-content {
padding: 0;
}
.window-app.mournblade-roll-dialog .window-content {
margin: 0;
padding: 0;
}
.mournblade-roll-dialog {
background: url("../assets/ui/pc_sheet_bg.webp");
background-repeat: repeat;
font-family: CentaurMT;
}
.mournblade-roll-dialog * {
color: #2a2a2a;
}
/* Header */
.mournblade-roll-dialog .dialog-header {
display: flex;
align-items: center;
gap: 10px;
padding: 8px;
background: linear-gradient(135deg, #4a0404 0%, #6d0808 100%);
border-bottom: 3px solid #8b0000;
margin-bottom: 0;
}
.mournblade-roll-dialog .dialog-header .actor-icon {
width: 48px;
height: 48px;
border-radius: 4px;
border: 2px solid #8b0000;
object-fit: cover;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.mournblade-roll-dialog .dialog-header .dialog-title {
flex: 1;
}
.mournblade-roll-dialog .dialog-header .dialog-title h3 {
margin: 0;
font-size: 1.1rem;
color: #f5f5f5;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
font-family: Charlemagne;
font-weight: bold;
}
.mournblade-roll-dialog .dialog-header .dialog-title .competence-name {
font-size: 0.85rem;
color: #ffcccb;
margin-top: 2px;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}
.mournblade-roll-dialog .dialog-header .dialog-title .competence-name .attribut-info {
color: #ffd700;
font-weight: bold;
font-size: 0.9em;
}
/* Content */
.mournblade-roll-dialog .dialog-content {
padding: 8px;
max-height: 650px;
overflow-y: auto;
}
.mournblade-roll-dialog .dialog-content::-webkit-scrollbar {
width: 8px;
}
.mournblade-roll-dialog .dialog-content::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.1);
border-radius: 4px;
}
.mournblade-roll-dialog .dialog-content::-webkit-scrollbar-thumb {
background: rgba(139, 0, 0, 0.6);
border-radius: 4px;
}
.mournblade-roll-dialog .dialog-content::-webkit-scrollbar-thumb:hover {
background: rgba(139, 0, 0, 0.8);
}
/* Form Groups */
.mournblade-roll-dialog .form-group {
margin-bottom: 8px;
}
.mournblade-roll-dialog .form-group label {
display: block;
font-weight: bold;
color: #1a1a1a;
text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5);
margin-bottom: 3px;
font-size: 0.9rem;
}
.mournblade-roll-dialog .form-group input,
.mournblade-roll-dialog .form-group select {
width: 100%;
padding: 5px 8px;
background: rgba(255, 255, 255, 0.95);
border: 1px solid rgba(100, 100, 100, 0.5);
border-radius: 3px;
color: #1a1a1a;
font-size: 0.95rem;
font-weight: 500;
font-family: CentaurMT;
}
.mournblade-roll-dialog .form-group input:focus,
.mournblade-roll-dialog .form-group select:focus {
outline: none;
border-color: #8b0000;
box-shadow: 0 0 5px rgba(139, 0, 0, 0.6);
background: #ffffff;
}
.mournblade-roll-dialog .form-group input:disabled,
.mournblade-roll-dialog .form-group select:disabled {
opacity: 0.7;
cursor: not-allowed;
background: rgba(200, 200, 200, 0.9);
color: #555;
}
/* Grids */
.mournblade-roll-dialog .modifiers-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 8px;
margin-bottom: 10px;
}
/* Sections spéciales */
.mournblade-roll-dialog .attributes-section {
background: rgba(139, 0, 0, 0.1);
padding: 8px;
border-radius: 4px;
border: 1px solid rgba(139, 0, 0, 0.3);
margin-bottom: 10px;
}
.mournblade-roll-dialog .rune-section {
background: rgba(75, 0, 130, 0.1);
padding: 8px;
border-radius: 4px;
border: 1px solid rgba(75, 0, 130, 0.3);
margin-bottom: 10px;
}
.mournblade-roll-dialog .weapon-section {
background: rgba(184, 134, 11, 0.1);
padding: 8px;
border-radius: 4px;
border: 1px solid rgba(184, 134, 11, 0.3);
margin-bottom: 10px;
}
.mournblade-roll-dialog .weapon-info {
display: flex;
justify-content: space-between;
align-items: center;
padding: 5px 8px;
background: rgba(184, 134, 11, 0.15);
border-radius: 3px;
margin-bottom: 8px;
}
.mournblade-roll-dialog .weapon-info .weapon-label {
font-weight: bold;
font-size: 0.9rem;
color: #1a1a1a;
}
.mournblade-roll-dialog .weapon-info .weapon-bonus {
font-size: 0.85rem;
color: #8b0000;
font-weight: bold;
}
.mournblade-roll-dialog .defense-info {
display: flex;
justify-content: space-between;
align-items: center;
padding: 4px 8px;
background: rgba(0, 100, 0, 0.1);
border-radius: 3px;
margin-bottom: 8px;
}
.mournblade-roll-dialog .defense-info .defense-label {
font-size: 0.85rem;
color: #1a1a1a;
font-weight: bold;
}
.mournblade-roll-dialog .defense-info .defense-value {
font-size: 1rem;
color: #006400;
font-weight: bold;
}
/* Combat modifiers */
.mournblade-roll-dialog .combat-modifiers,
.mournblade-roll-dialog .ranged-combat-section {
background: rgba(139, 0, 0, 0.1);
padding: 8px;
border-radius: 4px;
border: 1px solid rgba(139, 0, 0, 0.3);
margin-bottom: 10px;
}
.mournblade-roll-dialog .combat-modifiers h4,
.mournblade-roll-dialog .ranged-combat-section h4 {
margin: 0 0 8px 0;
color: #2a2a2a;
text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
font-size: 0.95rem;
font-weight: bold;
}
.mournblade-roll-dialog .modifiers-columns {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 5px 10px;
}
.mournblade-roll-dialog .checkbox-label {
display: flex;
align-items: center;
gap: 6px;
padding: 4px 6px;
cursor: pointer;
border-radius: 3px;
transition: background 0.2s ease;
}
.mournblade-roll-dialog .checkbox-label:hover {
background: rgba(255, 255, 255, 0.15);
}
.mournblade-roll-dialog .checkbox-label input[type="checkbox"] {
width: auto;
margin: 0;
cursor: pointer;
accent-color: #8b0000;
}
.mournblade-roll-dialog .checkbox-label span {
color: #1a1a1a;
font-size: 0.85rem;
user-select: none;
text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5);
}
.mournblade-roll-dialog .checkbox-label.highlight {
background: rgba(255, 215, 0, 0.15);
border: 1px solid rgba(255, 215, 0, 0.4);
font-weight: bold;
}
.mournblade-roll-dialog .info-message {
padding: 6px 10px;
background: rgba(33, 150, 243, 0.1);
border-left: 3px solid rgba(33, 150, 243, 0.6);
border-radius: 3px;
font-size: 0.85rem;
color: #1a1a1a;
margin-bottom: 8px;
}
/* Malus section */
.mournblade-roll-dialog .malus-section {
background: rgba(100, 100, 100, 0.1);
padding: 8px;
border-radius: 4px;
border: 1px solid rgba(100, 100, 100, 0.3);
margin-bottom: 10px;
}
.mournblade-roll-dialog .malus-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 8px;
}
.mournblade-roll-dialog .malus-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 4px 8px;
background: rgba(0, 0, 0, 0.05);
border-radius: 3px;
}
.mournblade-roll-dialog .malus-item .malus-label {
font-size: 0.85rem;
color: #2a2a2a;
font-weight: 500;
}
.mournblade-roll-dialog .malus-item .malus-value {
font-size: 0.95rem;
color: #8b0000;
font-weight: bold;
}
/* Registered modifiers */
.mournblade-roll-dialog .registered-modifiers {
background: rgba(75, 0, 130, 0.1);
padding: 8px;
border-radius: 4px;
border: 1px solid rgba(75, 0, 130, 0.3);
margin-bottom: 10px;
}
.mournblade-roll-dialog .registered-modifiers h4 {
margin: 0 0 6px 0;
color: #2a2a2a;
text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
font-size: 0.9rem;
font-weight: bold;
}
.mournblade-roll-dialog .registered-modifiers h4 i {
margin-right: 6px;
color: #4b0082;
}
.mournblade-roll-dialog .modifier-item {
margin-bottom: 4px;
}
/* Special option */
.mournblade-roll-dialog .special-option {
margin-top: 10px;
}
/* Dialog buttons */
.mournblade-roll-dialog .dialog-buttons {
display: flex;
gap: 10px;
padding: 10px;
border-top: 2px solid rgba(139, 0, 0, 0.3);
background: rgba(0, 0, 0, 0.05);
}
.mournblade-roll-dialog .dialog-buttons button {
flex: 1;
padding: 8px 14px;
border: none;
border-radius: 4px;
font-weight: bold;
cursor: pointer;
transition: all 0.2s ease;
font-size: 0.9rem;
font-family: Charlemagne;
text-transform: uppercase;
}
.mournblade-roll-dialog .dialog-buttons button[data-action="rolld10"],
.mournblade-roll-dialog .dialog-buttons button[data-action="rolld20"] {
background: linear-gradient(135deg, #8b0000 0%, #6d0808 100%);
color: #f5f5f5;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.mournblade-roll-dialog .dialog-buttons button[data-action="rolld10"]:hover,
.mournblade-roll-dialog .dialog-buttons button[data-action="rolld20"]:hover {
background: linear-gradient(135deg, #a00000 0%, #8b0000 100%);
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(139, 0, 0, 0.5);
}
.mournblade-roll-dialog .dialog-buttons button[data-action="cancel"] {
background: rgba(100, 100, 100, 0.3);
color: #2a2a2a;
}
.mournblade-roll-dialog .dialog-buttons button[data-action="cancel"]:hover {
background: rgba(100, 100, 100, 0.5);
}
/* ==================== Sheet Mode Toggle Button ==================== */
.sheet-mode-toggle {
background: linear-gradient(135deg, #8b0000 0%, #4a0404 100%);
border: 1px solid #8b0000;
border-radius: 3px;
color: #f5f5f5;
padding: 2px 4px;
cursor: pointer;
transition: all 0.2s;
font-size: 0.8rem;
width: 1.5rem;
height: 1.5rem;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
&:hover {
background: linear-gradient(135deg, #a00000 0%, #5a0505 100%);
transform: translateY(-1px);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
i {
margin: 0;
font-size: 0.75rem;
}
}
/* ==================== Chat Message Styles ==================== */
.mournblade-chat-result {
background: linear-gradient(135deg, rgba(74, 4, 4, 0.2) 0%, rgba(139, 0, 0, 0.15) 100%);
border: 2px solid #8b0000;
border-radius: 4px;
overflow: hidden;
font-family: CentaurMT, serif;
.chat-result-header {
background: linear-gradient(135deg, #4a0404 0%, #2a0202 100%);
border-bottom: 2px solid #8b0000;
padding: 8px;
display: flex;
align-items: center;
gap: 10px;
.actor-icon {
width: 48px;
height: 48px;
border-radius: 4px;
border: 1px solid #8b0000;
object-fit: cover;
flex-shrink: 0;
}
.header-info {
flex: 1;
.actor-name {
margin: 0;
color: #f5f5f5;
font-size: 1.1rem;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
}
.action-title {
color: #ffd700;
font-size: 0.9rem;
margin-top: 2px;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
i {
margin-right: 4px;
}
}
}
}
.result-main {
background: rgba(255, 250, 240, 0.9);
padding: 4px 8px;
border-bottom: 1px solid rgba(139, 0, 0, 0.3);
.result-display {
display: flex;
justify-content: space-around;
align-items: center;
gap: 8px;
margin-bottom: 3px;
.dice-result,
.total-result,
.difficulty {
text-align: center;
flex: 1;
background: rgba(255, 255, 255, 0.7);
padding: 4px 6px;
border-radius: 4px;
border: 1px solid rgba(139, 0, 0, 0.2);
i {
color: #8b0000;
font-size: 1rem;
display: block;
margin-bottom: 2px;
}
span {
display: block;
font-weight: bold;
}
.dice-value,
.total-value,
.difficulty-value {
font-size: 1.5rem;
color: #8b0000;
text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
font-weight: bold;
line-height: 1.2;
}
.total-label,
.difficulty-label {
font-size: 0.75rem;
color: #4a0404;
text-transform: uppercase;
font-weight: bold;
line-height: 1.1;
}
}
}
.result-badge-container {
display: flex;
justify-content: center;
margin-top: 4px;
.result-badge {
padding: 4px 12px;
border-radius: 3px;
font-weight: bold;
font-size: 0.9rem;
text-transform: uppercase;
text-align: center;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
i {
margin-right: 6px;
}
&.heroique {
background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
color: #1a1a1a;
text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}
&.success {
background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
color: white;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
&.failure {
background: linear-gradient(135deg, #8b0000 0%, #4a0404 100%);
color: white;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
&.dramatique {
background: linear-gradient(135deg, #4b0082 0%, #2d004d 100%);
color: white;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
}
}
}
.result-details {
padding: 8px;
background: rgba(255, 255, 255, 0.4);
.details-section {
display: flex;
flex-direction: column;
gap: 3px;
.detail-row {
display: flex;
justify-content: space-between;
padding: 3px 6px;
background: rgba(255, 255, 255, 0.5);
border-radius: 2px;
font-size: 0.85rem;
&.bonus {
background: rgba(255, 200, 200, 0.6);
border: 1px solid rgba(139, 0, 0, 0.5);
}
&.malus {
background: rgba(255, 180, 180, 0.6);
border: 1px solid rgba(100, 0, 0, 0.5);
}
&.rune {
background: rgba(200, 180, 255, 0.6);
border: 1px solid rgba(75, 0, 130, 0.5);
}
.detail-label {
color: #000000;
font-weight: bold;
}
.detail-value {
color: #000000;
font-weight: 500;
}
}
}
}
.result-effects {
padding: 8px;
background: rgba(255, 230, 230, 0.4);
border-top: 1px solid rgba(139, 0, 0, 0.3);
.effect-item {
padding: 5px 8px;
margin-bottom: 5px;
background: rgba(255, 255, 255, 0.7);
border-left: 3px solid #8b0000;
border-radius: 3px;
color: #000000;
font-size: 0.85rem;
&.victory {
background: rgba(255, 245, 200, 0.8);
border-left-color: #ffd700;
}
i {
margin-right: 6px;
color: #8b0000;
}
&:last-child {
margin-bottom: 0;
}
}
.damage-buttons {
display: flex;
flex-direction: column;
gap: 6px;
margin-top: 8px;
button {
width: 100%;
}
}
}
.result-warning {
padding: 8px;
background: rgba(255, 220, 180, 0.7);
border-top: 1px solid rgba(255, 165, 0, 0.4);
border-left: 3px solid #ff8c00;
color: #000000;
font-size: 0.85rem;
i {
margin-right: 6px;
color: #ff8c00;
}
}
.predilection-section {
padding: 8px;
background: rgba(220, 200, 255, 0.4);
border-top: 1px solid rgba(75, 0, 130, 0.3);
button {
width: 100%;
}
}
.chat-card-button {
background: linear-gradient(135deg, #8b0000 0%, #4a0404 100%);
border: 1px solid #8b0000;
border-radius: 3px;
color: #f5f5f5;
padding: 6px 12px;
font-family: CentaurMT, serif;
font-size: 0.9rem;
cursor: pointer;
transition: all 0.2s;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
i {
margin-right: 4px;
}
&:hover {
background: linear-gradient(135deg, #a00000 0%, #5a0505 100%);
transform: translateY(-1px);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
&.predilection-reroll {
background: linear-gradient(135deg, #4b0082 0%, #2d004d 100%);
border-color: #4b0082;
&:hover {
background: linear-gradient(135deg, #5b1092 0%, #3d005d 100%);
}
}
}
}
/* -------------------------------------------- */
/* Welcome Message Styling */
/* -------------------------------------------- */
.mournblade-welcome-message {
background: linear-gradient(135deg, rgba(139, 0, 0, 0.15) 0%, rgba(74, 4, 4, 0.2) 100%);
border: 2px solid #8b0000;
border-radius: 8px;
padding: 0;
margin: 8px 0;
overflow: hidden;
font-family: CentaurMT, serif;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
.welcome-header {
background: linear-gradient(135deg, #8b0000 0%, #4a0404 100%);
padding: 10px;
text-align: center;
border-bottom: 2px solid #ffd700;
position: relative;
.welcome-icon {
font-size: 1.8rem;
color: #ffd700;
margin-bottom: 4px;
text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
animation: pulse 2s ease-in-out infinite;
}
.welcome-title {
margin: 4px 0 2px 0;
font-size: 1.3rem;
font-weight: bold;
color: #ffd700;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
font-family: CentaurMT, serif;
line-height: 1.2;
}
.welcome-subtitle {
font-size: 0.9rem;
color: #f5e6d3;
font-style: italic;
margin-top: 2px;
line-height: 1.2;
}
}
.welcome-content {
padding: 12px;
background: rgba(245, 230, 211, 0.9);
.welcome-section {
display: flex;
gap: 10px;
margin-bottom: 10px;
padding: 8px;
background: rgba(255, 255, 255, 0.6);
border-left: 4px solid #8b0000;
border-radius: 4px;
&:last-child {
margin-bottom: 0;
}
.section-icon {
flex-shrink: 0;
font-size: 1.3rem;
color: #8b0000;
width: 28px;
text-align: center;
}
.section-text {
flex: 1;
color: #2a2a2a;
strong {
display: block;
color: #8b0000;
font-size: 1rem;
margin-bottom: 2px;
line-height: 1.2;
}
p {
margin: 2px 0;
line-height: 1.3;
font-size: 0.9rem;
}
.welcome-link {
display: inline-block;
margin-top: 4px;
color: #8b0000;
font-weight: 600;
text-decoration: none;
transition: all 0.2s;
font-size: 0.9rem;
i {
margin-right: 4px;
}
&:hover {
color: #a00000;
text-shadow: 0 0 4px rgba(139, 0, 0, 0.3);
transform: translateX(2px);
}
}
}
}
}
.welcome-footer {
background: linear-gradient(135deg, #4a0404 0%, #8b0000 100%);
padding: 8px;
text-align: center;
color: #ffd700;
font-style: italic;
font-size: 0.95rem;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
line-height: 1.2;
i {
font-size: 1rem;
}
}
}
@keyframes pulse {
0%, 100% {
transform: scale(1);
opacity: 1;
}
50% {
transform: scale(1.1);
opacity: 0.8;
}
}

View File

@@ -1,13 +1,13 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
* @extends {ActorSheetV2}
*/
import { MournbladeUtility } from "./mournblade-utility.js";
import { MournbladeRollDialog } from "./mournblade-roll-dialog.js";
/* -------------------------------------------- */
export class MournbladeActorSheet extends foundry.appv1.sheets.ActorSheet {
export class MournbladeActorSheet extends foundry.applications.sheets.ActorSheetV2 {
/** @override */
static get defaultOptions() {

View File

@@ -0,0 +1,158 @@
import { MournbladeUtility } from "../mournblade-utility.js"
/**
* Dialogue de jet de dé pour Mournblade - Version DialogV2
*/
export class MournbladeRollDialog {
/**
* Create and display the roll dialog
* @param {MournbladeActor} actor - The actor making the roll
* @param {Object} rollData - Data for the roll
* @returns {Promise<MournbladeRollDialog>}
*/
static async create(actor, rollData) {
// Préparer le contexte pour le template
const context = {
...rollData,
difficulte: String(rollData.difficulte || 0),
img: actor.img,
name: actor.name,
config: game.system.mournblade.config,
}
// Si attrKey est "tochoose", préparer la liste des attributs sélectionnables
if (rollData.attrKey === "tochoose") {
context.selectableAttributes = actor.system.attributs
}
// Rendre le template en HTML
const content = await foundry.applications.handlebars.renderTemplate(
"systems/fvtt-mournblade/templates/roll-dialog-v2.hbs",
context
)
// Utiliser DialogV2.wait avec le HTML rendu
return foundry.applications.api.DialogV2.wait({
window: { title: "Test de Capacité", icon: "fa-solid fa-dice-d20" },
classes: ["mournblade-roll-dialog"],
position: { width: 500 },
modal: false,
content,
buttons: [
{
action: "rolld10",
label: "Lancer 1d10",
icon: "fa-solid fa-dice-d10",
default: true,
callback: (event, button, dialog) => {
this._updateRollDataFromForm(rollData, button.form.elements, actor)
rollData.mainDice = "1d10"
MournbladeUtility.rollMournblade(rollData)
}
},
{
action: "rolld20",
label: "Lancer 1d20",
icon: "fa-solid fa-dice-d20",
callback: (event, button, dialog) => {
this._updateRollDataFromForm(rollData, button.form.elements, actor)
rollData.mainDice = "1d20"
MournbladeUtility.rollMournblade(rollData)
}
},
],
rejectClose: false,
})
}
/**
* Mettre à jour rollData avec les valeurs du formulaire
* @param {Object} rollData - L'objet rollData à mettre à jour
* @param {HTMLFormControlsCollection} formElements - Les éléments du formulaire
* @param {MournbladeActor} actor - L'acteur pour récupérer les attributs
* @private
*/
static _updateRollDataFromForm(rollData, formElements, actor) {
// Attributs
if (formElements.attrKey) {
rollData.attrKey = formElements.attrKey.value
if (rollData.attrKey !== "tochoose" && actor) {
rollData.attr = foundry.utils.duplicate(actor.system.attributs[rollData.attrKey])
rollData.actionImg = "systems/fvtt-mournblade/assets/icons/" + actor.system.attributs[rollData.attrKey].labelnorm + ".webp"
}
}
// Modificateurs de base
if (formElements.difficulte) {
rollData.difficulte = Number(formElements.difficulte.value)
}
if (formElements.modificateur) {
rollData.modificateur = Number(formElements.modificateur.value)
}
// Runes
if (formElements.runemode) {
rollData.runemode = String(formElements.runemode.value)
}
if (formElements.runeame) {
rollData.runeame = Number(formElements.runeame.value)
}
// Combat mêlée
if (formElements.typeAttaque) {
rollData.typeAttaque = String(formElements.typeAttaque.value)
}
if (formElements.isMonte !== undefined) {
rollData.isMonte = formElements.isMonte.checked
}
// Combat distance
if (formElements.visee !== undefined) {
rollData.visee = formElements.visee.checked
}
if (formElements.cibleconsciente !== undefined) {
rollData.cibleconsciente = formElements.cibleconsciente.checked
}
if (formElements.ciblecourt !== undefined) {
rollData.ciblecourt = formElements.ciblecourt.checked
}
if (formElements.typeCouvert) {
rollData.typeCouvert = String(formElements.typeCouvert.value)
}
// Désavantages
if (!rollData.desavantages) rollData.desavantages = {}
if (formElements.cibleausol !== undefined) {
rollData.desavantages.cibleausol = formElements.cibleausol.checked
}
if (formElements.cibledesarmee !== undefined) {
rollData.desavantages.cibledesarmee = formElements.cibledesarmee.checked
}
if (formElements.ciblerestreint !== undefined) {
rollData.desavantages.ciblerestreint = formElements.ciblerestreint.checked
}
if (formElements.cibleimmobilisée !== undefined) {
rollData.desavantages.cibleimmobilisée = formElements.cibleimmobilisée.checked
}
if (formElements.ciblesurplomb !== undefined) {
rollData.desavantages.ciblesurplomb = formElements.ciblesurplomb.checked
}
// Double D20
if (formElements.doubleD20 !== undefined) {
rollData.doubleD20 = formElements.doubleD20.checked
}
// Modifiers
if (rollData.modifiers) {
rollData.modifiers.forEach((modifier, idx) => {
const checkbox = formElements[`apply-modifier-${idx}`]
if (checkbox) {
modifier.system.apply = checkbox.checked
}
})
}
}
}

View File

@@ -0,0 +1,29 @@
/**
* Index des applications AppV2 pour Mournblade
* Ce fichier centralise tous les exports des applications
*/
// Applications de feuilles d'acteurs
export { default as MournbladePersonnageSheet } from './mournblade-personnage-sheet.mjs';
export { default as MournbladeCreatureSheet } from './mournblade-creature-sheet.mjs';
export { default as MournbladePnjSheet } from './mournblade-pnj-sheet.mjs';
// Applications de feuilles d'items
export { default as MournbladeArmeSheet } from './mournblade-arme-sheet.mjs';
export { default as MournbladeBouclierSheet } from './mournblade-bouclier-sheet.mjs';
export { default as MournbladeCapaciteSheet } from './mournblade-capacite-sheet.mjs';
export { default as MournbladeCompetenceSheet } from './mournblade-competence-sheet.mjs';
export { default as MournbladeDonSheet } from './mournblade-don-sheet.mjs';
export { default as MournbladeEquipementSheet } from './mournblade-equipement-sheet.mjs';
export { default as MournbladeHeritageSheet } from './mournblade-heritage-sheet.mjs';
export { default as MournbladeMetierSheet } from './mournblade-metier-sheet.mjs';
export { default as MournbladeModifierSheet } from './mournblade-modifier-sheet.mjs';
export { default as MournbladeMonnaieSheet } from './mournblade-monnaie-sheet.mjs';
export { default as MournbladeOrigineSheet } from './mournblade-origine-sheet.mjs';
export { default as MournbladePacteSheet } from './mournblade-pacte-sheet.mjs';
export { default as MournbladeProtectionSheet } from './mournblade-protection-sheet.mjs';
export { default as MournbladeRuneSheet } from './mournblade-rune-sheet.mjs';
export { default as MournbladeRuneEffectSheet } from './mournblade-runeeffect-sheet.mjs';
export { default as MournbladeTendanceSheet } from './mournblade-tendance-sheet.mjs';
export { default as MournbladeTraitChaotiqueSheet } from './mournblade-traitchaotique-sheet.mjs';
export { default as MournbladeTraitEspeceSheet } from './mournblade-traitespece-sheet.mjs';

View File

@@ -0,0 +1,406 @@
const { HandlebarsApplicationMixin } = foundry.applications.api
import { MournbladeUtility } from "../../mournblade-utility.js"
export default class MournbladeActorSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ActorSheetV2) {
/**
* Different sheet modes.
* @enum {number}
*/
static SHEET_MODES = { EDIT: 0, PLAY: 1 }
constructor(options = {}) {
super(options)
this.#dragDrop = this.#createDragDropHandlers()
this._sheetMode = this.constructor.SHEET_MODES.PLAY // Commencer en mode visualisation
}
#dragDrop
/** @override */
static DEFAULT_OPTIONS = {
classes: ["fvtt-mournblade", "sheet", "actor"],
position: {
width: 650,
height: 720,
},
form: {
submitOnChange: true,
closeOnSubmit: false,
},
window: {
resizable: true,
},
tabs: [
{
navSelector: 'nav[data-group="primary"]',
contentSelector: "section.sheet-body",
initial: "stats",
},
],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
actions: {
editImage: MournbladeActorSheet.#onEditImage,
toggleSheet: MournbladeActorSheet.#onToggleSheet,
editItem: MournbladeActorSheet.#onEditItem,
deleteItem: MournbladeActorSheet.#onDeleteItem,
createItem: MournbladeActorSheet.#onCreateItem,
equipItem: MournbladeActorSheet.#onEquipItem,
modifyQuantity: MournbladeActorSheet.#onModifyQuantity,
modifySante: MournbladeActorSheet.#onModifySante,
modifyAme: MournbladeActorSheet.#onModifyAme,
rollAttribut: MournbladeActorSheet.#onRollAttribut,
rollCompetence: MournbladeActorSheet.#onRollCompetence,
rollRune: MournbladeActorSheet.#onRollRune,
rollArmeOffensif: MournbladeActorSheet.#onRollArmeOffensif,
rollArmeSpecial: MournbladeActorSheet.#onRollArmeSpecial,
rollArmeDegats: MournbladeActorSheet.#onRollArmeDegats,
rollAssommer: MournbladeActorSheet.#onRollAssommer,
rollImmobiliser: MournbladeActorSheet.#onRollImmobiliser,
rollFuir: MournbladeActorSheet.#onRollFuir,
},
}
/**
* Is the sheet currently in 'Play' mode?
* @type {boolean}
*/
get isPlayMode() {
if (this._sheetMode === undefined) this._sheetMode = this.constructor.SHEET_MODES.PLAY
return this._sheetMode === this.constructor.SHEET_MODES.PLAY
}
/**
* Is the sheet currently in 'Edit' mode?
* @type {boolean}
*/
get isEditMode() {
if (this._sheetMode === undefined) this._sheetMode = this.constructor.SHEET_MODES.PLAY
return this._sheetMode === this.constructor.SHEET_MODES.EDIT
}
/**
* Tab groups state
* @type {object}
*/
tabGroups = { primary: "stats" }
/** @override */
async _prepareContext() {
const actor = this.document
const context = {
actor: actor,
system: actor.system,
source: actor.toObject(),
fields: actor.schema.fields,
systemFields: actor.system.schema.fields,
isEditable: this.isEditable,
isEditMode: this.isEditMode,
isPlayMode: this.isPlayMode,
isGM: game.user.isGM,
config: game.system.mournblade.config,
enrichedDescription: await foundry.applications.ux.TextEditor.implementation.enrichHTML(actor.system.biodata?.description || "", { async: true }),
}
return context
}
/** @override */
_onRender(context, options) {
super._onRender(context, options)
this.#dragDrop.forEach((d) => d.bind(this.element))
// Handle edit-item-data changes
this.element.querySelectorAll('.edit-item-data').forEach(element => {
element.addEventListener('change', async (event) => {
const target = event.currentTarget
const itemElement = target.closest('[data-item-id]')
if (!itemElement) return
const itemId = itemElement.dataset.itemId
const itemType = itemElement.dataset.itemType
const itemField = target.dataset.itemField
const dataType = target.dataset.dtype
const value = target.value
await this.document.editItemField(itemId, itemType, itemField, dataType, value)
})
})
// Activate tab navigation manually
const nav = this.element.querySelector('nav.tabs[data-group]')
if (nav) {
const group = nav.dataset.group
// Activate the current tab
const activeTab = this.tabGroups[group] || "stats"
nav.querySelectorAll('[data-tab]').forEach(link => {
const tab = link.dataset.tab
link.classList.toggle('active', tab === activeTab)
link.addEventListener('click', (event) => {
event.preventDefault()
this.tabGroups[group] = tab
this.render()
})
})
// Show/hide tab content
this.element.querySelectorAll('[data-group="' + group + '"][data-tab]').forEach(content => {
content.classList.toggle('active', content.dataset.tab === activeTab)
})
}
}
// #region Drag-and-Drop Workflow
/**
* Create drag-and-drop workflow handlers for this Application
*/
#createDragDropHandlers() {
return []
}
// #region Actions
/** @override */
static ACTIONS = {
editImage: MournbladeActorSheet.#onEditImage,
toggleSheet: MournbladeActorSheet.#onToggleSheet,
editItem: MournbladeActorSheet.#onEditItem,
deleteItem: MournbladeActorSheet.#onDeleteItem,
createItem: MournbladeActorSheet.#onCreateItem,
equipItem: MournbladeActorSheet.#onEquipItem,
modifyQuantity: MournbladeActorSheet.#onModifyQuantity,
rollAttribut: MournbladeActorSheet.#onRollAttribut,
rollCompetence: MournbladeActorSheet.#onRollCompetence,
rollArmeOffensif: MournbladeActorSheet.#onRollArmeOffensif,
rollArmeDegats: MournbladeActorSheet.#onRollArmeDegats,
rollAssommer: MournbladeActorSheet.#onRollAssommer,
rollImmobiliser: MournbladeActorSheet.#onRollImmobiliser,
rollFuir: MournbladeActorSheet.#onRollFuir,
}
/**
* Handle editing the actor image
* @param {Event} event - The triggering event
*/
static async #onEditImage(event) {
event.preventDefault()
const sheet = this
const filePicker = new FilePicker({
type: "image",
current: sheet.document.img,
callback: (path) => {
sheet.document.update({ img: path })
},
})
filePicker.browse()
}
/**
* Handle toggling the sheet mode
* @param {Event} event - The triggering event
*/
static async #onToggleSheet(event) {
event.preventDefault()
const sheet = this
sheet._sheetMode = sheet._sheetMode === sheet.constructor.SHEET_MODES.PLAY ? sheet.constructor.SHEET_MODES.EDIT : sheet.constructor.SHEET_MODES.PLAY
sheet.render()
}
/**
* Handle editing an item
* @param {Event} event - The triggering event
* @param {HTMLElement} target - The target element
*/
static async #onEditItem(event, target) {
const li = target.closest(".item")
const itemId = li?.dataset.itemId
if (!itemId) return
const item = this.actor.items.get(itemId)
if (item) item.sheet.render(true)
}
/**
* Handle deleting an item
* @param {Event} event - The triggering event
* @param {HTMLElement} target - The target element
*/
static async #onDeleteItem(event, target) {
const li = target.closest(".item")
await MournbladeUtility.confirmDelete(this, li)
}
/**
* Handle creating an item
* @param {Event} event - The triggering event
* @param {HTMLElement} target - The target element
*/
static async #onCreateItem(event, target) {
const itemType = target.dataset.type
await this.actor.createEmbeddedDocuments("Item", [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
}
/**
* Handle equipping an item
* @param {Event} event - The triggering event
* @param {HTMLElement} target - The target element
*/
static async #onEquipItem(event, target) {
const li = target.closest(".item")
const itemId = li?.dataset.itemId
if (!itemId) return
const item = this.actor.items.get(itemId)
if (item) {
await item.update({ "system.equipped": !item.system.equipped })
}
}
/**
* Handle modifying the quantity of an item
* @param {Event} event - The triggering event
* @param {HTMLElement} target - The target element
*/
static async #onModifyQuantity(event, target) {
const li = target.closest('[data-item-id]')
const itemId = li?.dataset.itemId
const value = Number.parseInt(target.dataset.quantiteValue)
const item = this.document.items.get(itemId)
if (item) {
const newQuantity = Math.max(0, (item.system.quantite || 0) + value)
await item.update({ "system.quantite": newQuantity })
}
}
/**
* Handle modifying santé (health) values
* @param {Event} event - The triggering event
* @param {HTMLElement} target - The target element
*/
static async #onModifySante(event, target) {
const type = target.dataset.type
const value = Number.parseInt(target.dataset.value)
const actor = this.document
const currentValue = actor.system.sante[type] || 0
const newValue = Math.max(0, currentValue + value)
await actor.update({ [`system.sante.${type}`]: newValue })
}
/**
* Handle modifying âme (soul) value
* @param {Event} event - The triggering event
* @param {HTMLElement} target - The target element
*/
static async #onModifyAme(event, target) {
const value = Number.parseInt(target.dataset.value)
const actor = this.document
const currentValue = actor.system.ame.value || 0
const newValue = Math.max(0, currentValue + value)
await actor.update({ "system.ame.value": newValue })
}
/**
* Handle rolling an attribut
* @param {Event} event - The triggering event
*/
static async #onRollAttribut(event, target) {
event.preventDefault()
const sheet = this
const attrKey = target.dataset.attrKey
const actor = sheet.document
await actor.rollAttribut(attrKey)
}
/**
* Handle rolling a competence
* @param {Event} event - The triggering event
*/
static async #onRollCompetence(event, target) {
event.preventDefault()
const sheet = this
const attrKey = target.dataset.attrKey
const li = target.closest('[data-item-id]')
const compId = li?.dataset.itemId
const actor = sheet.document
await actor.rollCompetence(attrKey, compId)
}
/**
* Handle rolling a rune
* @param {Event} event - The triggering event
*/
static async #onRollRune(event, target) {
event.preventDefault()
const sheet = this
const li = target.closest('[data-item-id]')
const runeId = li?.dataset.itemId
const actor = sheet.document
await actor.rollRune(runeId)
}
/**
* Handle rolling an arme offensif
* @param {Event} event - The triggering event
*/
static async #onRollArmeOffensif(event, target) {
event.preventDefault()
const sheet = this
const armeId = target.dataset.armeId
const actor = sheet.document
await actor.rollArmeOffensif(armeId)
}
/**
* Handle rolling an arme degats
* @param {Event} event - The triggering event
*/
static async #onRollArmeDegats(event, target) {
event.preventDefault()
const sheet = this
const armeId = target.dataset.armeId
const actor = sheet.document
await actor.rollArmeDegats(armeId)
}
/**
* Handle rolling an arme special
* @param {Event} event - The triggering event
*/
static async #onRollArmeSpecial(event, target) {
event.preventDefault()
const sheet = this
const armeId = target.dataset.armeId
const actor = sheet.document
await actor.rollArmeSpecial(armeId)
}
/**
* Handle rolling an assommer
* @param {Event} event - The triggering event
*/
static async #onRollAssommer(event, target) {
event.preventDefault()
const sheet = this
const actor = sheet.document
await actor.rollAssomer()
}
/**
* Handle rolling an immobiliser
* @param {Event} event - The triggering event
*/
static async #onRollImmobiliser(event, target) {
event.preventDefault()
const sheet = this
const actor = sheet.document
await actor.rollImmobiliser()
}
/**
* Handle rolling a fuir
* @param {Event} event - The triggering event
*/
static async #onRollFuir(event, target) {
event.preventDefault()
const sheet = this
const actor = sheet.document
await actor.rollFuir()
}
}

View File

@@ -0,0 +1,142 @@
const { HandlebarsApplicationMixin } = foundry.applications.api
export default class MournbladeItemSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ItemSheetV2) {
constructor(options = {}) {
super(options)
this.#dragDrop = this.#createDragDropHandlers()
}
#dragDrop
/** @override */
static DEFAULT_OPTIONS = {
classes: ["fvtt-mournblade", "item"],
position: {
width: 620,
height: 600,
},
form: {
submitOnChange: true,
},
window: {
resizable: true,
},
tabs: [
{
navSelector: 'nav[data-group="primary"]',
contentSelector: "section.sheet-body",
initial: "description",
},
],
dragDrop: [{ dragSelector: "[data-drag]", dropSelector: null }],
actions: {
editImage: MournbladeItemSheet.#onEditImage,
postItem: MournbladeItemSheet.#onPostItem,
},
}
/**
* Tab groups state
* @type {object}
*/
tabGroups = { primary: "description" }
/** @override */
async _prepareContext() {
const context = {
fields: this.document.schema.fields,
systemFields: this.document.system.schema.fields,
item: this.document,
system: this.document.system,
source: this.document.toObject(),
enrichedDescription: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.description, { async: true }),
isEditMode: true,
isEditable: this.isEditable,
isGM: game.user.isGM,
config: game.system.mournblade.config,
}
return context
}
/** @override */
_onRender(context, options) {
super._onRender(context, options)
this.#dragDrop.forEach((d) => d.bind(this.element))
// Activate tab navigation manually
const nav = this.element.querySelector('nav.tabs[data-group]')
if (nav) {
const group = nav.dataset.group
// Activate the current tab
const activeTab = this.tabGroups[group] || "description"
nav.querySelectorAll('[data-tab]').forEach(link => {
const tab = link.dataset.tab
link.classList.toggle('active', tab === activeTab)
link.addEventListener('click', (event) => {
event.preventDefault()
this.tabGroups[group] = tab
this.render()
})
})
// Show/hide tab content
this.element.querySelectorAll('[data-group="' + group + '"][data-tab]').forEach(content => {
content.classList.toggle('active', content.dataset.tab === activeTab)
})
}
}
// #region Drag-and-Drop Workflow
/**
* Create drag-and-drop workflow handlers for this Application
*/
#createDragDropHandlers() {
return []
}
// #region Actions
/**
* Handle editing the item image
* @param {Event} event - The triggering event
*/
static async #onEditImage(event) {
event.preventDefault()
const filePicker = new FilePicker({
type: "image",
current: this.document.img,
callback: (path) => {
this.document.update({ img: path })
},
})
filePicker.browse()
}
/**
* Handle posting the item to chat
* @param {Event} event - The triggering event
*/
static async #onPostItem(event) {
event.preventDefault()
let chatData = foundry.utils.duplicate(this.document)
if (this.document.actor) {
chatData.actor = { id: this.document.actor.id }
}
// Don't post any image for the item if the default image is used
if (chatData.img.includes("/blank.png")) {
chatData.img = null
}
// JSON object for easy creation
chatData.jsondata = JSON.stringify({
compendium: "postedItem",
payload: chatData,
})
const html = await renderTemplate('systems/fvtt-mournblade/templates/post-item.hbs', chatData)
const chatOptions = {
user: game.user.id,
content: html,
}
ChatMessage.create(chatOptions)
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeArmeSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["arme"],
position: {
width: 620,
},
window: {
contentClasses: ["arme-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-arme-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeBouclierSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["bouclier"],
position: {
width: 620,
},
window: {
contentClasses: ["bouclier-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-bouclier-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeCapaciteSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["capacite"],
position: {
width: 620,
},
window: {
contentClasses: ["capacite-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-capacite-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeCompetenceSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["competence"],
position: {
width: 620,
},
window: {
contentClasses: ["competence-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-competence-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,43 @@
import MournbladeActorSheet from "./base-actor-sheet.mjs"
export default class MournbladeCreatureSheet extends MournbladeActorSheet {
/** @override */
static DEFAULT_OPTIONS = {
...super.DEFAULT_OPTIONS,
classes: [...super.DEFAULT_OPTIONS.classes],
window: {
...super.DEFAULT_OPTIONS.window,
title: "SHEETS.Actor.creature",
},
}
/** @override */
static PARTS = {
sheet: {
template: "systems/fvtt-mournblade/templates/creature-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "stats",
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
const actor = this.document
// Add creature-specific data
context.skills = actor.getSkills()
context.armes = foundry.utils.duplicate(actor.getWeapons())
context.protections = foundry.utils.duplicate(actor.getArmors())
context.runes = foundry.utils.duplicate(actor.getRunes())
context.combat = actor.getCombatValues()
context.equipements = foundry.utils.duplicate(actor.getEquipments())
context.protectionTotal = actor.getProtectionTotal()
context.santeMalus = actor.getStatusMalus()
context.ameMalus = actor.getAmeMalus()
return context
}
}

View File

@@ -0,0 +1,50 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeDonSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["don"],
position: {
width: 620,
},
window: {
contentClasses: ["don-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-don-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
context.enrichedSacrifice = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.sacrifice, { async: true })
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeEquipementSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["equipement"],
position: {
width: 620,
},
window: {
contentClasses: ["equipement-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-equipement-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeHeritageSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["heritage"],
position: {
width: 620,
},
window: {
contentClasses: ["heritage-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-heritage-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeMetierSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["metier"],
position: {
width: 620,
},
window: {
contentClasses: ["metier-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-metier-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeModifierSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["modifier"],
position: {
width: 620,
},
window: {
contentClasses: ["modifier-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-modifier-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeMonnaieSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["monnaie"],
position: {
width: 620,
},
window: {
contentClasses: ["monnaie-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-monnaie-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeOrigineSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["origine"],
position: {
width: 620,
},
window: {
contentClasses: ["origine-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-origine-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladePacteSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["pacte"],
position: {
width: 620,
},
window: {
contentClasses: ["pacte-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-pacte-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,57 @@
import MournbladeActorSheet from "./base-actor-sheet.mjs"
export default class MournbladePersonnageSheet extends MournbladeActorSheet {
/** @override */
static DEFAULT_OPTIONS = {
...super.DEFAULT_OPTIONS,
classes: [...super.DEFAULT_OPTIONS.classes],
window: {
...super.DEFAULT_OPTIONS.window,
title: "SHEETS.Actor.personnage",
},
}
/** @override */
static PARTS = {
sheet: {
template: "systems/fvtt-mournblade/templates/actor-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "principal",
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
const actor = this.document
// Add personnage-specific data
context.skills = actor.getSkills()
context.armes = foundry.utils.duplicate(actor.getWeapons())
context.protections = foundry.utils.duplicate(actor.getArmors())
context.dons = foundry.utils.duplicate(actor.getDons())
context.pactes = foundry.utils.duplicate(actor.getPactes())
context.alignement = actor.getAlignement()
context.aspect = actor.getAspect()
context.marge = actor.getMarge()
context.tendances = foundry.utils.duplicate(actor.getTendances())
context.runes = foundry.utils.duplicate(actor.getRunes())
context.traitsChaotiques = foundry.utils.duplicate(actor.getTraitsChaotiques())
context.traitsEspeces = foundry.utils.duplicate(actor.getTraitsEspeces())
context.origine = foundry.utils.duplicate(actor.getOrigine() || {})
context.heritage = foundry.utils.duplicate(actor.getHeritage() || {})
context.metier = foundry.utils.duplicate(actor.getMetier() || {})
context.combat = actor.getCombatValues()
context.equipements = foundry.utils.duplicate(actor.getEquipments())
context.modifiers = foundry.utils.duplicate(actor.getModifiers())
context.monnaies = foundry.utils.duplicate(actor.getMonnaies())
context.runeEffects = foundry.utils.duplicate(actor.getRuneEffects())
context.protectionTotal = actor.getProtectionTotal()
context.santeMalus = actor.getStatusMalus()
context.ameMalus = actor.getAmeMalus()
return context
}
}

View File

@@ -0,0 +1,47 @@
/**
* Application de feuille de PNJ pour Mournblade
*/
import MournbladeActorSheet from "./base-actor-sheet.mjs"
export default class MournbladePnjSheet extends MournbladeActorSheet {
/** @override */
static DEFAULT_OPTIONS = {
...super.DEFAULT_OPTIONS,
classes: [...super.DEFAULT_OPTIONS.classes],
window: {
...super.DEFAULT_OPTIONS.window,
title: "SHEETS.Actor.pnj",
},
}
/** @override */
static PARTS = {
sheet: {
template: "systems/fvtt-mournblade/templates/actor-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "principal",
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
const actor = this.document
// Add pnj-specific data
context.skills = actor.getSkills()
context.armes = foundry.utils.duplicate(actor.getWeapons())
context.protections = foundry.utils.duplicate(actor.getArmors())
context.dons = foundry.utils.duplicate(actor.getDons())
context.pactes = foundry.utils.duplicate(actor.getPactes())
context.combat = actor.getCombatValues()
context.equipements = foundry.utils.duplicate(actor.getEquipments())
context.protectionTotal = actor.getProtectionTotal()
context.santeMalus = actor.getStatusMalus()
context.ameMalus = actor.getAmeMalus()
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeProtectionSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["protection"],
position: {
width: 620,
},
window: {
contentClasses: ["protection-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-protection-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeRuneSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["rune"],
position: {
width: 620,
},
window: {
contentClasses: ["rune-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-rune-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeRuneEffectSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["runeeffect"],
position: {
width: 620,
},
window: {
contentClasses: ["runeeffect-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-runeeffect-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeTendanceSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["tendance"],
position: {
width: 620,
},
window: {
contentClasses: ["tendance-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-tendance-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeTraitChaotiqueSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["traitchaotique"],
position: {
width: 620,
},
window: {
contentClasses: ["traitchaotique-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-traitchaotique-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

View File

@@ -0,0 +1,49 @@
import MournbladeItemSheet from "./base-item-sheet.mjs"
export default class MournbladeTraitEspeceSheet extends MournbladeItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["traitespece"],
position: {
width: 620,
},
window: {
contentClasses: ["traitespece-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade/templates/item-traitespece-sheet.hbs",
},
}
/** @override */
tabGroups = {
primary: "description",
}
/**
* Prepare an array of form header tabs.
* @returns {Record<string, Partial<ApplicationTab>>}
*/
#getTabs() {
const tabs = {
details: { id: "details", group: "primary", label: "Détails" },
description: { id: "description", group: "primary", label: "Description" }
}
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] === v.id
v.cssClass = v.active ? "active" : ""
}
return tabs
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.tabs = this.#getTabs()
return context
}
}

27
modules/models/arme.mjs Normal file
View File

@@ -0,0 +1,27 @@
/**
* Data model pour les armes
*/
export default class ArmeDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" }),
typearme: new fields.StringField({ initial: "" }),
isdefense: new fields.BooleanField({ initial: false }),
bonusmaniementoff: new fields.NumberField({ initial: 0, integer: true }),
bonusmaniementdef: new fields.NumberField({ initial: 0, integer: true }),
ignorearmure: new fields.BooleanField({ initial: false }),
nbressources: new fields.NumberField({ initial: 0, integer: true }),
degats: new fields.StringField({ initial: "" }),
nonletaux: new fields.BooleanField({ initial: false }),
deuxmains: new fields.BooleanField({ initial: false }),
courte: new fields.NumberField({ initial: 0, integer: true }),
moyenne: new fields.NumberField({ initial: 0, integer: true }),
longue: new fields.NumberField({ initial: 0, integer: true }),
tr: new fields.NumberField({ initial: 0, integer: true }),
rarete: new fields.NumberField({ initial: 0, integer: true }),
prix: new fields.NumberField({ initial: 0, integer: true }),
equipped: new fields.BooleanField({ initial: false })
};
}
}

View File

@@ -0,0 +1,11 @@
/**
* Data model de base pour les items Mournblade
*/
export default class BaseItemDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" })
};
}
}

View File

@@ -0,0 +1,17 @@
/**
* Data model pour les boucliers
*/
export default class BouclierDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" }),
bonusdefense: new fields.NumberField({ initial: 0, integer: true }),
degats: new fields.StringField({ initial: "" }),
nonletaux: new fields.BooleanField({ initial: false }),
rarete: new fields.NumberField({ initial: 0, integer: true }),
prix: new fields.NumberField({ initial: 0, integer: true }),
equipped: new fields.BooleanField({ initial: false })
};
}
}

View File

@@ -0,0 +1,11 @@
/**
* Data model pour les capacités
*/
export default class CapaciteDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" })
};
}
}

View File

@@ -0,0 +1,17 @@
/**
* Data model pour les compétences
*/
export default class CompetenceDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" }),
niveau: new fields.NumberField({ initial: 0, integer: true }),
attribut1: new fields.StringField({ initial: "" }),
attribut2: new fields.StringField({ initial: "" }),
attribut3: new fields.StringField({ initial: "" }),
doublebonus: new fields.BooleanField({ initial: false }),
predilections: new fields.ArrayField(new fields.StringField(), { initial: [] })
};
}
}

103
modules/models/creature.mjs Normal file
View File

@@ -0,0 +1,103 @@
/**
* Data model pour les créatures
*/
export default class CreatureDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
// Template biodata
biodata: new fields.SchemaField({
name: new fields.StringField({ initial: "" }),
age: new fields.NumberField({ initial: 0, integer: true }),
alignement: new fields.StringField({ initial: "" }),
poids: new fields.StringField({ initial: "" }),
taille: new fields.StringField({ initial: "" }),
cheveux: new fields.StringField({ initial: "" }),
sexe: new fields.StringField({ initial: "" }),
yeux: new fields.StringField({ initial: "" }),
description: new fields.HTMLField({ initial: "" }),
amemultiplier: new fields.NumberField({ initial: 2, integer: true }),
ignoreamemalus: new fields.BooleanField({ initial: false }),
ignoresantemalus: new fields.BooleanField({ initial: false }),
notes: new fields.HTMLField({ initial: "" }),
gmnotes: new fields.HTMLField({ initial: "" })
}),
// Template core
subactors: new fields.ArrayField(new fields.StringField(), { initial: [] }),
attributs: new fields.SchemaField({
adr: new fields.SchemaField({
label: new fields.StringField({ initial: "Adresse" }),
labelnorm: new fields.StringField({ initial: "adresse" }),
abbrev: new fields.StringField({ initial: "adr" }),
value: new fields.NumberField({ initial: 1, integer: true })
}),
pui: new fields.SchemaField({
label: new fields.StringField({ initial: "Puissance" }),
labelnorm: new fields.StringField({ initial: "puissance" }),
abbrev: new fields.StringField({ initial: "pui" }),
value: new fields.NumberField({ initial: 1, integer: true })
}),
cla: new fields.SchemaField({
label: new fields.StringField({ initial: "Clairvoyance" }),
labelnorm: new fields.StringField({ initial: "clairvoyance" }),
abbrev: new fields.StringField({ initial: "cla" }),
value: new fields.NumberField({ initial: 1, integer: true })
}),
pre: new fields.SchemaField({
label: new fields.StringField({ initial: "Présence" }),
labelnorm: new fields.StringField({ initial: "presence" }),
abbrev: new fields.StringField({ initial: "pre" }),
value: new fields.NumberField({ initial: 0, integer: true })
}),
tre: new fields.SchemaField({
label: new fields.StringField({ initial: "Trempe" }),
labelnorm: new fields.StringField({ initial: "trempe" }),
abbrev: new fields.StringField({ initial: "tre" }),
value: new fields.NumberField({ initial: 0, integer: true })
})
}),
bonneaventure: new fields.SchemaField({
base: new fields.NumberField({ initial: 0, integer: true }),
actuelle: new fields.NumberField({ initial: 0, integer: true })
}),
experience: new fields.SchemaField({
value: new fields.NumberField({ initial: 0, integer: true })
}),
eclat: new fields.SchemaField({
value: new fields.NumberField({ initial: 0, integer: true })
}),
sante: new fields.SchemaField({
base: new fields.NumberField({ initial: 0, integer: true }),
bonus: new fields.NumberField({ initial: 0, integer: true }),
nonletaux: new fields.NumberField({ initial: 0, integer: true }),
letaux: new fields.NumberField({ initial: 0, integer: true }),
malusmanuel: new fields.NumberField({ initial: 0, integer: true }),
sequelles: new fields.StringField({ initial: "" })
}),
ame: new fields.SchemaField({
fullmax: new fields.NumberField({ initial: 0, integer: true }),
currentmax: new fields.NumberField({ initial: 0, integer: true }),
value: new fields.NumberField({ initial: 0, integer: true }),
traumatismes: new fields.StringField({ initial: "" })
}),
combat: new fields.SchemaField({
initbonus: new fields.NumberField({ initial: 0, integer: true }),
vitessebonus: new fields.NumberField({ initial: 0, integer: true }),
bonusdegats: new fields.NumberField({ initial: 0, integer: true }),
defensebonus: new fields.NumberField({ initial: 0, integer: true }),
monte: new fields.BooleanField({ initial: false })
}),
balance: new fields.SchemaField({
loi: new fields.NumberField({ initial: 0, integer: true }),
chaos: new fields.NumberField({ initial: 0, integer: true }),
aspect: new fields.NumberField({ initial: 0, integer: true }),
marge: new fields.NumberField({ initial: 0, integer: true }),
pointschaos: new fields.NumberField({ initial: 0, integer: true }),
pointsloi: new fields.NumberField({ initial: 0, integer: true })
}),
ressources: new fields.SchemaField({
value: new fields.NumberField({ initial: 0, integer: true })
})
};
}
}

14
modules/models/don.mjs Normal file
View File

@@ -0,0 +1,14 @@
/**
* Data model pour les dons
*/
export default class DonDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" }),
allegeance: new fields.StringField({ initial: "" }),
prerequis: new fields.StringField({ initial: "" }),
sacrifice: new fields.HTMLField({ initial: "" })
};
}
}

View File

@@ -0,0 +1,13 @@
/**
* Data model pour les équipements
*/
export default class EquipementDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" }),
rarete: new fields.NumberField({ initial: 0, integer: true }),
prix: new fields.NumberField({ initial: 0, integer: true })
};
}
}

View File

@@ -0,0 +1,11 @@
/**
* Data model pour les héritages
*/
export default class HeritageDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" })
};
}
}

28
modules/models/index.mjs Normal file
View File

@@ -0,0 +1,28 @@
/**
* Index des DataModels pour Mournblade
* Ce fichier centralise tous les exports des modèles de données
*/
// Modèles d'items
export { default as ArmeDataModel } from './arme.mjs';
export { default as BouclierDataModel } from './bouclier.mjs';
export { default as CapaciteDataModel } from './capacite.mjs';
export { default as CompetenceDataModel } from './competence.mjs';
export { default as DonDataModel } from './don.mjs';
export { default as EquipementDataModel } from './equipement.mjs';
export { default as HeritageDataModel } from './heritage.mjs';
export { default as MetierDataModel } from './metier.mjs';
export { default as ModifierDataModel } from './modifier.mjs';
export { default as MonnaieDataModel } from './monnaie.mjs';
export { default as OrigineDataModel } from './origine.mjs';
export { default as PacteDataModel } from './pacte.mjs';
export { default as ProtectionDataModel } from './protection.mjs';
export { default as RuneDataModel } from './rune.mjs';
export { default as RuneEffectDataModel } from './runeeffect.mjs';
export { default as TendanceDataModel } from './tendance.mjs';
export { default as TraitChaotiqueDataModel } from './traitchaotique.mjs';
export { default as TraitEspeceDataModel } from './traitespece.mjs';
// Modèles d'acteurs
export { default as PersonnageDataModel } from './personnage.mjs';
export { default as CreatureDataModel } from './creature.mjs';

11
modules/models/metier.mjs Normal file
View File

@@ -0,0 +1,11 @@
/**
* Data model pour les métiers
*/
export default class MetierDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" })
};
}
}

View File

@@ -0,0 +1,18 @@
/**
* Data model pour les modificateurs
*/
export default class ModifierDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" }),
modifiertype: new fields.StringField({ initial: "roll" }),
value: new fields.NumberField({ initial: 0, integer: true }),
attribut: new fields.StringField({ initial: "aucun" }),
competence: new fields.StringField({ initial: "aucun" }),
permanent: new fields.BooleanField({ initial: true }),
once: new fields.BooleanField({ initial: false }),
duree: new fields.StringField({ initial: "" })
};
}
}

View File

@@ -0,0 +1,13 @@
/**
* Data model pour les monnaies
*/
export default class MonnaieDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" }),
quantite: new fields.NumberField({ initial: 0, integer: true }),
unite: new fields.StringField({ initial: "" })
};
}
}

View File

@@ -0,0 +1,11 @@
/**
* Data model pour les origines
*/
export default class OrigineDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" })
};
}
}

12
modules/models/pacte.mjs Normal file
View File

@@ -0,0 +1,12 @@
/**
* Data model pour les pactes
*/
export default class PacteDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" }),
allegeance: new fields.StringField({ initial: "" })
};
}
}

View File

@@ -0,0 +1,100 @@
/**
* Data model pour les personnages
*/
export default class PersonnageDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
// Template biodata
biodata: new fields.SchemaField({
name: new fields.StringField({ initial: "" }),
age: new fields.NumberField({ initial: 0, integer: true }),
alignement: new fields.StringField({ initial: "" }),
poids: new fields.StringField({ initial: "" }),
taille: new fields.StringField({ initial: "" }),
cheveux: new fields.StringField({ initial: "" }),
sexe: new fields.StringField({ initial: "" }),
yeux: new fields.StringField({ initial: "" }),
description: new fields.HTMLField({ initial: "" }),
amemultiplier: new fields.NumberField({ initial: 2, integer: true }),
ignoreamemalus: new fields.BooleanField({ initial: false }),
ignoresantemalus: new fields.BooleanField({ initial: false }),
notes: new fields.HTMLField({ initial: "" }),
gmnotes: new fields.HTMLField({ initial: "" })
}),
// Template core
subactors: new fields.ArrayField(new fields.StringField(), { initial: [] }),
attributs: new fields.SchemaField({
adr: new fields.SchemaField({
label: new fields.StringField({ initial: "Adresse" }),
labelnorm: new fields.StringField({ initial: "adresse" }),
abbrev: new fields.StringField({ initial: "adr" }),
value: new fields.NumberField({ initial: 1, integer: true })
}),
pui: new fields.SchemaField({
label: new fields.StringField({ initial: "Puissance" }),
labelnorm: new fields.StringField({ initial: "puissance" }),
abbrev: new fields.StringField({ initial: "pui" }),
value: new fields.NumberField({ initial: 1, integer: true })
}),
cla: new fields.SchemaField({
label: new fields.StringField({ initial: "Clairvoyance" }),
labelnorm: new fields.StringField({ initial: "clairvoyance" }),
abbrev: new fields.StringField({ initial: "cla" }),
value: new fields.NumberField({ initial: 1, integer: true })
}),
pre: new fields.SchemaField({
label: new fields.StringField({ initial: "Présence" }),
labelnorm: new fields.StringField({ initial: "presence" }),
abbrev: new fields.StringField({ initial: "pre" }),
value: new fields.NumberField({ initial: 0, integer: true })
}),
tre: new fields.SchemaField({
label: new fields.StringField({ initial: "Trempe" }),
labelnorm: new fields.StringField({ initial: "trempe" }),
abbrev: new fields.StringField({ initial: "tre" }),
value: new fields.NumberField({ initial: 0, integer: true })
})
}),
bonneaventure: new fields.SchemaField({
base: new fields.NumberField({ initial: 0, integer: true }),
actuelle: new fields.NumberField({ initial: 0, integer: true })
}),
experience: new fields.SchemaField({
value: new fields.NumberField({ initial: 0, integer: true })
}),
eclat: new fields.SchemaField({
value: new fields.NumberField({ initial: 0, integer: true })
}),
sante: new fields.SchemaField({
base: new fields.NumberField({ initial: 0, integer: true }),
bonus: new fields.NumberField({ initial: 0, integer: true }),
nonletaux: new fields.NumberField({ initial: 0, integer: true }),
letaux: new fields.NumberField({ initial: 0, integer: true }),
malusmanuel: new fields.NumberField({ initial: 0, integer: true }),
sequelles: new fields.StringField({ initial: "" })
}),
ame: new fields.SchemaField({
fullmax: new fields.NumberField({ initial: 0, integer: true }),
currentmax: new fields.NumberField({ initial: 0, integer: true }),
value: new fields.NumberField({ initial: 0, integer: true }),
traumatismes: new fields.StringField({ initial: "" })
}),
combat: new fields.SchemaField({
initbonus: new fields.NumberField({ initial: 0, integer: true }),
vitessebonus: new fields.NumberField({ initial: 0, integer: true }),
bonusdegats: new fields.NumberField({ initial: 0, integer: true }),
defensebonus: new fields.NumberField({ initial: 0, integer: true }),
monte: new fields.BooleanField({ initial: false })
}),
balance: new fields.SchemaField({
loi: new fields.NumberField({ initial: 0, integer: true }),
chaos: new fields.NumberField({ initial: 0, integer: true }),
aspect: new fields.NumberField({ initial: 0, integer: true }),
marge: new fields.NumberField({ initial: 0, integer: true }),
pointschaos: new fields.NumberField({ initial: 0, integer: true }),
pointsloi: new fields.NumberField({ initial: 0, integer: true })
})
};
}
}

View File

@@ -0,0 +1,17 @@
/**
* Data model pour les protections
*/
export default class ProtectionDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" }),
typeprotection: new fields.StringField({ initial: "" }),
protection: new fields.NumberField({ initial: 0, integer: true }),
degats: new fields.StringField({ initial: "" }),
rarete: new fields.NumberField({ initial: 0, integer: true }),
prix: new fields.NumberField({ initial: 0, integer: true }),
equipped: new fields.BooleanField({ initial: false })
};
}
}

15
modules/models/rune.mjs Normal file
View File

@@ -0,0 +1,15 @@
/**
* Data model pour les runes
*/
export default class RuneDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" }),
formule: new fields.StringField({ initial: "" }),
seuil: new fields.NumberField({ initial: 0, integer: true }),
prononcee: new fields.StringField({ initial: "" }),
tracee: new fields.StringField({ initial: "" })
};
}
}

View File

@@ -0,0 +1,15 @@
/**
* Data model pour les effets de runes
*/
export default class RuneEffectDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" }),
rune: new fields.StringField({ initial: "" }),
mode: new fields.StringField({ initial: "" }),
duree: new fields.StringField({ initial: "" }),
pointame: new fields.NumberField({ initial: 0, integer: true })
};
}
}

View File

@@ -0,0 +1,12 @@
/**
* Data model pour les tendances
*/
export default class TendanceDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" }),
allegeance: new fields.StringField({ initial: "" })
};
}
}

View File

@@ -0,0 +1,11 @@
/**
* Data model pour les traits chaotiques
*/
export default class TraitChaotiqueDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" })
};
}
}

View File

@@ -0,0 +1,11 @@
/**
* Data model pour les traits d'espèce
*/
export default class TraitEspeceDataModel extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" })
};
}
}

View File

@@ -1,6 +1,6 @@
/* -------------------------------------------- */
import { MournbladeUtility } from "./mournblade-utility.js";
import { MournbladeRollDialog } from "./mournblade-roll-dialog.js";
import { MournbladeRollDialog } from "./applications/mournblade-roll-dialog.mjs";
/* -------------------------------------------- */
const __degatsBonus = [-2, -2, -1, -1, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 8, 8, 9, 9, 10, 10]
@@ -12,6 +12,28 @@ const __vitesseBonus = [-2, -2, -1, -1, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6
* @extends {Actor}
*/
export class MournbladeActor extends Actor {
prepareData() {
super.prepareData();
// Calculate derived attributes
const data = this.system;
// Calculate total health
data.sante.total = data.sante.base + data.sante.bonus;
// Calculate current health
data.sante.current = data.sante.total - data.sante.nonletaux - data.sante.letaux;
// Calculate total ame
data.ame.total = data.ame.fullmax;
// Calculate balance
data.balance.total = data.balance.loi + data.balance.chaos;
}
prepareDerivedData() {
this.prepareData();
}
/* -------------------------------------------- */
/**
@@ -64,22 +86,38 @@ export class MournbladeActor extends Actor {
let combat = this.getCombatValues()
if (arme.system.typearme == "contact" || arme.system.typearme == "contactjet") {
arme.system.isMelee = true
arme.system.competence = foundry.utils.duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "mêlée"))
arme.system.attrKey = "pui"
arme.system.totalDegats = arme.system.degats + "+" + combat.bonusDegatsTotal
arme.system.totalOffensif = this.system.attributs.pui.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff + combat.attaqueModifier
if (arme.system.isdefense) {
arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.bonusmaniementdef
let competence = this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "mêlée")
if (competence) {
arme.system.competence = foundry.utils.duplicate(competence)
arme.system.attrKey = "pui"
arme.system.totalDegats = arme.system.degats + "+" + combat.bonusDegatsTotal
arme.system.totalOffensif = this.system.attributs.pui.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff + combat.attaqueModifier
if (arme.system.isdefense) {
arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.bonusmaniementdef
}
} else {
arme.system.competence = null
arme.system.totalOffensif = 0
arme.system.totalDegats = arme.system.degats
arme.system.totalDefensif = 0
}
}
if (arme.system.typearme == "jet" || arme.system.typearme == "tir") {
arme.system.isDistance = true
arme.system.competence = foundry.utils.duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "armes à distance"))
arme.system.attrKey = "adr"
arme.system.totalOffensif = this.system.attributs.adr.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff + combat.attaqueModifier
arme.system.totalDegats = arme.system.degats
if (arme.system.isdefense) {
arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.bonusmaniementdef
let competence = this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "armes à distance")
if (competence) {
arme.system.competence = foundry.utils.duplicate(competence)
arme.system.attrKey = "adr"
arme.system.totalOffensif = this.system.attributs.adr.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff + combat.attaqueModifier
arme.system.totalDegats = arme.system.degats
if (arme.system.isdefense) {
arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.bonusmaniementdef
}
} else {
arme.system.competence = null
arme.system.totalOffensif = 0
arme.system.totalDegats = arme.system.degats
arme.system.totalDefensif = 0
}
}
return arme
@@ -88,13 +126,21 @@ export class MournbladeActor extends Actor {
prepareBouclier(bouclier) {
bouclier = foundry.utils.duplicate(bouclier)
let combat = this.getCombatValues()
bouclier.system.competence = foundry.utils.duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "mêlée"))
bouclier.system.attrKey = "pui"
bouclier.system.totalDegats = bouclier.system.degats + "+" + combat.bonusDegatsTotal
bouclier.system.totalOffensif = this.system.attributs.pui.value + bouclier.system.competence.system.niveau
bouclier.system.isdefense = true
bouclier.system.bonusmaniementoff = 0
bouclier.system.totalDefensif = combat.defenseTotal + bouclier.system.competence.system.niveau + bouclier.system.bonusdefense
let competence = this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "mêlée")
if (competence) {
bouclier.system.competence = foundry.utils.duplicate(competence)
bouclier.system.attrKey = "pui"
bouclier.system.totalDegats = bouclier.system.degats + "+" + combat.bonusDegatsTotal
bouclier.system.totalOffensif = this.system.attributs.pui.value + bouclier.system.competence.system.niveau
bouclier.system.isdefense = true
bouclier.system.bonusmaniementoff = 0
bouclier.system.totalDefensif = combat.defenseTotal + bouclier.system.competence.system.niveau + bouclier.system.bonusdefense
} else {
bouclier.system.competence = null
bouclier.system.totalOffensif = 0
bouclier.system.totalDegats = bouclier.system.degats
bouclier.system.totalDefensif = 0
}
return bouclier
}
@@ -258,11 +304,13 @@ export class MournbladeActor extends Actor {
if (this.type == 'personnage') {
let newSante = this.system.sante.bonus + (this.system.attributs.pui.value + this.system.attributs.tre.value) * 2 + 5
if (this.system.sante.base != newSante) {
if (this.system.sante.base != newSante && this._id) {
// Only update if the actor already exists (has an _id)
this.update({ 'system.sante.base': newSante })
}
let newAme = (this.system.attributs.cla.value + this.system.attributs.tre.value) * this.system.biodata.amemultiplier + 5
if (this.system.ame.fullmax != newAme) {
if (this.system.ame.fullmax != newAme && this._id) {
// Only update if the actor already exists (has an _id)
this.update({ 'system.ame.fullmax': newAme })
}
}
@@ -589,16 +637,14 @@ export class MournbladeActor extends Actor {
/* -------------------------------------------- */
async rollAttribut(attrKey) {
let rollData = this.getCommonRollData(attrKey)
let rollDialog = await MournbladeRollDialog.create(this, rollData)
rollDialog.render(true)
await MournbladeRollDialog.create(this, rollData)
}
/* -------------------------------------------- */
async rollCompetence(attrKey, compId) {
let rollData = this.getCommonRollData(attrKey, compId)
console.log("RollDatra", rollData)
let rollDialog = await MournbladeRollDialog.create(this, rollData)
rollDialog.render(true)
await MournbladeRollDialog.create(this, rollData)
}
/* -------------------------------------------- */
@@ -614,8 +660,7 @@ export class MournbladeActor extends Actor {
rollData.runemode = "prononcer"
rollData.runeame = 1
console.log("runeData", rollData)
let rollDialog = await MournbladeRollDialog.create(this, rollData)
rollDialog.render(true)
await MournbladeRollDialog.create(this, rollData)
}
/* -------------------------------------------- */
@@ -642,8 +687,7 @@ export class MournbladeActor extends Actor {
}
console.log("ARME!", rollData)
this.depenseRessources(arme)
let rollDialog = await MournbladeRollDialog.create(this, rollData)
rollDialog.render(true)
await MournbladeRollDialog.create(this, rollData)
}
/* -------------------------------------------- */
@@ -657,8 +701,7 @@ export class MournbladeActor extends Actor {
rollData.difficulte = rollData.defender.system.attributs.tre.value * 2
}
console.log("Assomer!", rollData)
let rollDialog = await MournbladeRollDialog.create(this, rollData)
rollDialog.render(true)
await MournbladeRollDialog.create(this, rollData)
}
/* -------------------------------------------- */
async rollFuir() {
@@ -672,8 +715,7 @@ export class MournbladeActor extends Actor {
rollData.difficulte = rollData.defender.system.attributs.adr.value + ((comp) ? comp.system.niveau : rollData.defender.system.attributs.adr.value)
}
console.log("Fuir!", rollData)
let rollDialog = await MournbladeRollDialog.create(this, rollData)
rollDialog.render(true)
await MournbladeRollDialog.create(this, rollData)
}
/* -------------------------------------------- */
async rollImmobiliser() {
@@ -686,15 +728,14 @@ export class MournbladeActor extends Actor {
rollData.difficulte = rollData.defenderCombatValues.defenseTotal
}
console.log("Immobiliser!", rollData)
let rollDialog = await MournbladeRollDialog.create(this, rollData)
rollDialog.render(true)
await MournbladeRollDialog.create(this, rollData)
}
/* -------------------------------------------- */
async rollArmeSpecial(armeId) {
let arme = this.items.get(armeId)
if (arme) {
MournbladeUtility.createChatWithRollMode("GM", {
content: await renderTemplate(`systems/fvtt-mournblade/templates/chat-display-description.html`, arme)
content: await renderTemplate(`systems/fvtt-mournblade/templates/chat-display-description.hbs`, arme)
}, arme)
this.depenseRessources(arme)
}
@@ -722,7 +763,7 @@ export class MournbladeActor extends Actor {
actionImg: arme.img,
}
MournbladeUtility.createChatWithRollMode(rollData.alias, {
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-mournblade/templates/chat-degats-result.html`, rollData)
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-mournblade/templates/chat-degats-result-v2.hbs`, rollData)
})
}

View File

@@ -116,8 +116,7 @@ export class MournbladeCommands {
rollData.mode = "generic"
rollData.title = `Dice Pool Roll`;
let rollDialog = await MournbladeRollDialog.create( this, rollData);
rollDialog.render( true );
await MournbladeRollDialog.create( this, rollData);
}
}

View File

@@ -11,7 +11,7 @@ export class MournbladeItemSheet extends foundry.appv1.sheets.ItemSheet {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade", "sheet", "item"],
template: "systems/fvtt-mournblade/templates/item-sheet.html",
template: "systems/fvtt-mournblade/templates/item-sheet.hbs",
dragDrop: [{ dragSelector: null, dropSelector: null }],
width: 620,
height: 550
@@ -106,7 +106,7 @@ export class MournbladeItemSheet extends foundry.appv1.sheets.ItemSheet {
payload: chatData,
});
renderTemplate('systems/fvtt-Mournblade-rpg/templates/post-item.html', chatData).then(html => {
renderTemplate('systems/fvtt-mournblade/templates/post-item.hbs', chatData).then(html => {
let chatOptions = MournbladeUtility.chatDataSetup(html);
ChatMessage.create(chatOptions)
});
@@ -169,7 +169,7 @@ export class MournbladeItemSheet extends foundry.appv1.sheets.ItemSheet {
/* -------------------------------------------- */
get template() {
let type = this.item.type;
return `systems/fvtt-mournblade/templates/item-${type}-sheet.html`;
return `systems/fvtt-mournblade/templates/item-${type}-sheet.hbs`;
}
/* -------------------------------------------- */

View File

@@ -10,13 +10,20 @@
// Import Modules
import { MournbladeActor } from "./mournblade-actor.js";
import { MournbladeItemSheet } from "./mournblade-item-sheet.js";
import { MournbladeActorSheet } from "./mournblade-actor-sheet.js";
import { MournbladeCreatureSheet } from "./mournblade-creature-sheet.js";
// import { MournbladeActorSheet } from "./mournblade-actor-sheet.js";
// import { MournbladeCreatureSheet } from "./mournblade-creature-sheet.js";
import { MournbladeUtility } from "./mournblade-utility.js";
import { MournbladeCombat } from "./mournblade-combat.js";
import { MournbladeItem } from "./mournblade-item.js";
import { MournbladeConfig } from "./mournblade-config.js";
// Import DataModels
import * as models from "./models/index.mjs";
// Import AppV2 Item Sheets
import * as sheets from "./applications/sheets/_module.mjs";
import { MournbladeRollDialog } from "./mournblade-roll-dialog.js";
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
@@ -45,35 +52,80 @@ Hooks.once("init", async function () {
// Define custom Entity classes
CONFIG.Combat.documentClass = MournbladeCombat
CONFIG.Actor.documentClass = MournbladeActor
CONFIG.Actor.dataModels = {
personnage: models.PersonnageDataModel,
creature: models.CreatureDataModel,
}
CONFIG.Item.documentClass = MournbladeItem
CONFIG.Item.dataModels = {
arme: models.ArmeDataModel,
bouclier: models.BouclierDataModel,
capacite: models.CapaciteDataModel,
competence: models.CompetenceDataModel,
don: models.DonDataModel,
equipement: models.EquipementDataModel,
heritage: models.HeritageDataModel,
metier: models.MetierDataModel,
modifier: models.ModifierDataModel,
monnaie: models.MonnaieDataModel,
origine: models.OrigineDataModel,
pacte: models.PacteDataModel,
protection: models.ProtectionDataModel,
rune: models.RuneDataModel,
runeeffect: models.RuneEffectDataModel,
tendance: models.TendanceDataModel,
traitchaotique: models.TraitChaotiqueDataModel,
traitespece: models.TraitEspeceDataModel
}
game.system.mournblade = {
config : MournbladeConfig.getConfig(),
models,
sheets,
MournbladeRollDialog
}
/* -------------------------------------------- */
// Register sheet application classes
foundry.documents.collections.Actors.unregisterSheet("core", foundry.appv1.sheets.ActorSheet);
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade", MournbladeActorSheet, { types: ["personnage"], makeDefault: true })
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade", MournbladeCreatureSheet, { types: ["creature"], makeDefault: true })
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade", sheets.MournbladePersonnageSheet, { types: ["personnage"], makeDefault: true });
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade", sheets.MournbladeCreatureSheet, { types: ["creature"], makeDefault: true });
foundry.documents.collections.Items.unregisterSheet("core", foundry.appv1.sheets.ItemSheet);
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", MournbladeItemSheet, { makeDefault: true })
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeArmeSheet, { types: ["arme"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeBouclierSheet, { types: ["bouclier"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeCapaciteSheet, { types: ["capacite"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeCompetenceSheet, { types: ["competence"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeDonSheet, { types: ["don"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeEquipementSheet, { types: ["equipement"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeHeritageSheet, { types: ["heritage"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeMetierSheet, { types: ["metier"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeModifierSheet, { types: ["modifier"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeMonnaieSheet, { types: ["monnaie"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeOrigineSheet, { types: ["origine"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladePacteSheet, { types: ["pacte"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeProtectionSheet, { types: ["protection"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeRuneSheet, { types: ["rune"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeRuneEffectSheet, { types: ["runeeffect"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeTendanceSheet, { types: ["tendance"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeTraitChaotiqueSheet, { types: ["traitchaotique"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade", sheets.MournbladeTraitEspeceSheet, { types: ["traitespece"], makeDefault: true });
MournbladeUtility.init();
});
/* -------------------------------------------- */
function welcomeMessage() {
async function welcomeMessage() {
const templateData = {};
const html = await renderTemplate("systems/fvtt-mournblade/templates/chat-welcome-message.hbs", templateData);
ChatMessage.create({
user: game.user.id,
whisper: [game.user.id],
content: `<div id="welcome-message-Mournblade"><span class="rdd-roll-part">
<strong>Bienvenue dans les Jeunes Royaumes de Mournblade !</strong>
<p>Les livres de Mournblade sont nécessaires pour jouer : https://www.titam-france.fr</p>
<p>Mournblade est jeu de rôle publié par Titam France/Sombres projets, tout les droits leur appartiennent.</p>
<p>Système développé par LeRatierBretonnien, support sur le <a href="https://discord.gg/pPSDNJk">Discord FR de Foundry</a>.</p>
` });
content: html
});
}
/* -------------------------------------------- */

View File

@@ -1,56 +1,56 @@
import { MournbladeUtility } from "./mournblade-utility.js";
export class MournbladeRollDialog extends Dialog {
export class MournbladeRollDialog extends Application {
/* -------------------------------------------- */
static async create(actor, rollData ) {
let options = { classes: ["MournbladeDialog"], width: 340, height: 'fit-content', 'z-index': 99999 };
let html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-mournblade/templates/roll-dialog-generic.html', rollData);
return new MournbladeRollDialog(actor, rollData, html, options );
return new MournbladeRollDialog(actor, rollData);
}
/* -------------------------------------------- */
constructor(actor, rollData, html, options, close = undefined) {
let conf = {
title: "Test de Capacité",
content: html,
buttons: {
rolld10: {
icon: '<i class="fas fa-check"></i>',
label: "Lancer 1d10",
callback: () => { this.roll("1d10") }
},
rolld20: {
icon: '<i class="fas fa-check"></i>',
label: "Lancer 1d20",
callback: () => { this.roll("1d20") }
},
cancel: {
icon: '<i class="fas fa-times"></i>',
label: "Annuler",
callback: () => { this.close() }
} },
close: close
constructor(actor, rollData, options = {}) {
super(options);
this.actor = actor;
this.rollData = rollData;
}
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade", "sheet", "item"],
template: "systems/fvtt-mournblade/templates/roll-dialog-generic.hbs",
width: 400,
height: "auto",
title: "Test de Capacité"
});
}
getData() {
const data = foundry.utils.duplicate(this.rollData);
if (!data.config) {
data.config = game.system.mournblade.config;
}
return data;
}
super(conf, options);
this.actor = actor
this.rollData = rollData
_onCancel() {
this.close();
}
/* -------------------------------------------- */
roll ( dice) {
this.rollData.mainDice = dice
MournbladeUtility.rollMournblade( this.rollData )
_onRoll(dice) {
this.rollData.mainDice = dice;
MournbladeUtility.rollMournblade(this.rollData);
this.close();
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
// Roll buttons
html.find(".rolld10").click(this._onRoll.bind(this, "1d10"));
html.find(".rolld20").click(this._onRoll.bind(this, "1d20"));
html.find(".cancel").click(this._onCancel.bind(this));
function onLoad() {
}

View File

@@ -163,8 +163,10 @@ export class MournbladeUtility {
static async preloadHandlebarsTemplates() {
const templatePaths = [
'systems/fvtt-mournblade/templates/editor-notes-gm.html',
'systems/fvtt-mournblade/templates/partial-item-description.html'
'systems/fvtt-mournblade/templates/editor-notes-gm.hbs',
'systems/fvtt-mournblade/templates/partial-item-description.hbs',
'systems/fvtt-mournblade/templates/partial-item-header.hbs',
'systems/fvtt-mournblade/templates/partial-item-nav.hbs'
]
return foundry.applications.handlebars.loadTemplates(templatePaths);
}
@@ -371,7 +373,7 @@ export class MournbladeUtility {
if (rollData.visee) {
rollData.diceFormula += "+5"
}
if (rollData.cibleconsciente) {
if (rollData.cibleconsciente && rollData.defender) {
rollData.diceFormula += `-${rollData.defender.system.attributs.adr.value}`
}
if (rollData.ciblecourt) {
@@ -381,7 +383,7 @@ export class MournbladeUtility {
rollData.diceFormula += `-10`
}
}
if (rollData.typeCouvert != "aucun") {
if (rollData.typeCouvert && rollData.typeCouvert != "aucun" && rollData.config.couverts[rollData.typeCouvert]) {
rollData.diceFormula += `+${rollData.config.couverts[rollData.typeCouvert].value}`
}
}
@@ -427,7 +429,7 @@ export class MournbladeUtility {
actor.setModifier("Charge de Cavalerie : -5 défense pour le tour", "defense", -5)
}
this.createChatWithRollMode(rollData.alias, {
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-mournblade/templates/chat-generic-result.html`, rollData)
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-mournblade/templates/chat-generic-result-v2.hbs`, rollData)
}, rollData)
}
@@ -521,7 +523,7 @@ export class MournbladeUtility {
}
this.createChatWithRollMode(rollData.alias, {
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-mournblade/templates/chat-degats-result.html`, rollData)
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-mournblade/templates/chat-degats-result-v2.hbs`, rollData)
}, rollData)
}
@@ -575,7 +577,7 @@ export class MournbladeUtility {
this.computeQualityResult(rollData)
this.createChatWithRollMode(rollData.alias, {
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-mournblade/templates/chat-generic-result.html`, rollData)
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-mournblade/templates/chat-generic-result-v2.hbs`, rollData)
}, rollData)
}
@@ -845,7 +847,7 @@ export class MournbladeUtility {
/* -------------------------------------------- */
static async confirmDelete(actorSheet, li) {
let itemId = li.data("item-id");
let itemId = li.dataset?.itemId || li.data("item-id");
let msgTxt = "<p>Voulez vous supprimer cet item ?";
let buttons = {
delete: {
@@ -853,7 +855,7 @@ export class MournbladeUtility {
label: "Oui !",
callback: () => {
actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId]);
li.slideUp(200, () => actorSheet.render(false));
actorSheet.render(false);
}
},
cancel: {

1
node_modules/.bin/acorn generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../acorn/bin/acorn

1
node_modules/.bin/atob generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../atob/bin/atob.js

1
node_modules/.bin/color-support generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../color-support/bin.js

1
node_modules/.bin/errno generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../errno/cli.js

1
node_modules/.bin/gulp generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../gulp/bin/gulp.js

1
node_modules/.bin/image-size generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../image-size/bin/image-size.js

1
node_modules/.bin/lessc generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../less/bin/lessc

1
node_modules/.bin/mime generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../mime/cli.js

1
node_modules/.bin/needle generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../needle/bin/needle

1
node_modules/.bin/resolve generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../resolve/bin/resolve

1
node_modules/.bin/semver generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../semver/bin/semver

1
node_modules/.bin/which generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../which/bin/which

4962
node_modules/.package-lock.json generated vendored Normal file

File diff suppressed because it is too large Load Diff

21
node_modules/@gulp-sourcemaps/identity-map/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2017 Blaine Bublitz <blaine.bublitz@gmail.com>
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.

40
node_modules/@gulp-sourcemaps/identity-map/README.md generated vendored Normal file
View File

@@ -0,0 +1,40 @@
# @gulp-sourcemaps/identity-map
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url]
Gulp plugin for generating an identity sourcemap for a file.
## Example
```js
var identityMap = require('@gulp-sourcemaps/identity-map');
gulp.src(...)
.pipe(sourcemaps.init())
.pipe(identityMap()) // .js and .css files will get a generated sourcemap
.pipe(sourcemaps.write())
.pipe(gulp.dest(...))
```
## API
### `identityMap()`
Returns an `objectMode` Transform stream that processes each file with a `.sourceMap` property and buffered contents. A sourcemap is generated and attached for each `.js` and `.css` file.
## License
MIT
[downloads-image]: http://img.shields.io/npm/dm/@gulp-sourcemaps/identity-map.svg
[npm-url]: https://npmjs.org/package/@gulp-sourcemaps/identity-map
[npm-image]: http://img.shields.io/npm/v/@gulp-sourcemaps/identity-map.svg
[travis-url]: https://travis-ci.org/gulp-sourcemaps/identity-map
[travis-image]: http://img.shields.io/travis/gulp-sourcemaps/identity-map.svg?label=travis-ci
[appveyor-url]: https://ci.appveyor.com/project/phated/identity-map
[appveyor-image]: https://img.shields.io/appveyor/ci/phated/identity-map.svg?label=appveyor
[coveralls-url]: https://coveralls.io/r/gulp-sourcemaps/identity-map
[coveralls-image]: http://img.shields.io/coveralls/gulp-sourcemaps/identity-map.svg

35
node_modules/@gulp-sourcemaps/identity-map/index.js generated vendored Normal file
View File

@@ -0,0 +1,35 @@
'use strict';
var through = require('through2');
var normalizePath = require('normalize-path');
var generate = require('./lib/generate');
function identityMap() {
function transform(file, _, cb) {
if (!file.sourceMap || !file.isBuffer()) {
return cb(null, file);
}
var sourcePath = normalizePath(file.relative);
var contents = file.contents.toString();
switch (file.extname) {
case '.js': {
file.sourceMap = generate.js(sourcePath, contents);
break;
}
case '.css': {
file.sourceMap = generate.css(sourcePath, contents);
break;
}
}
cb(null, file);
}
return through.obj(transform);
}
module.exports = identityMap;

View File

@@ -0,0 +1,53 @@
'use strict';
var acorn = require('acorn');
var postcss = require('postcss');
var SourceMapGenerator = require('source-map').SourceMapGenerator;
function generateJs(sourcePath, fileContent) {
var generator = new SourceMapGenerator({ file: sourcePath });
var tokenizer = acorn.tokenizer(fileContent, {
allowHashBang: true,
locations: true,
});
/* eslint no-constant-condition: 0 */
while (true) {
var token = tokenizer.getToken();
if (token.type.label === 'eof') {
break;
}
var mapping = {
original: token.loc.start,
generated: token.loc.start,
source: sourcePath,
};
if (token.type.label === 'name') {
mapping.name = token.value;
}
generator.addMapping(mapping);
}
generator.setSourceContent(sourcePath, fileContent);
return generator.toJSON();
}
var postcssSourceMapOptions = {
inline: false,
prev: false,
sourcesContent: true,
annotation: false,
};
function generateCss(sourcePath, fileContent) {
var root = postcss.parse(fileContent, { from: sourcePath });
var result = root.toResult({ to: sourcePath, map: postcssSourceMapOptions });
return result.map.toJSON();
}
module.exports = {
js: generateJs,
css: generateCss,
};

View File

@@ -0,0 +1,9 @@
# The MIT License (MIT)
**Copyright (c) Rod Vagg (the "Original Author") and additional 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.

View File

@@ -0,0 +1,134 @@
# through2
[![NPM](https://nodei.co/npm/through2.png?downloads&downloadRank)](https://nodei.co/npm/through2/)
**A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise**
Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`.
***Note: Users of Node.js 0.10 and 0.12 should install `through2@2.x`. As of through2@3.x, readable-stream@3 is being used and is not compatible with older versions of Node.js.*** _v2.x support is being maintained on the [v2.x](https://github.com/rvagg/through2/tree/v2.x) branch._
```js
fs.createReadStream('ex.txt')
.pipe(through2(function (chunk, enc, callback) {
for (var i = 0; i < chunk.length; i++)
if (chunk[i] == 97)
chunk[i] = 122 // swap 'a' for 'z'
this.push(chunk)
callback()
}))
.pipe(fs.createWriteStream('out.txt'))
.on('finish', () => doSomethingSpecial())
```
Or object streams:
```js
var all = []
fs.createReadStream('data.csv')
.pipe(csv2())
.pipe(through2.obj(function (chunk, enc, callback) {
var data = {
name : chunk[0]
, address : chunk[3]
, phone : chunk[10]
}
this.push(data)
callback()
}))
.on('data', (data) => {
all.push(data)
})
.on('end', () => {
doSomethingSpecial(all)
})
```
Note that `through2.obj(fn)` is a convenience wrapper around `through2({ objectMode: true }, fn)`.
## API
<b><code>through2([ options, ] [ transformFunction ] [, flushFunction ])</code></b>
Consult the **[stream.Transform](https://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`).
### options
The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams (or just use `through2.obj()`).
The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call:
```js
fs.createReadStream('/tmp/important.dat')
.pipe(through2({ objectMode: true, allowHalfOpen: false },
(chunk, enc, cb) => {
cb(null, 'wut?') // note we can use the second argument on the callback
// to provide data as an alternative to this.push('wut?')
}
))
.pipe(fs.createWriteStream('/tmp/wut.txt'))
```
### transformFunction
The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk.
To queue a new chunk, call `this.push(chunk)`&mdash;this can be called as many times as required before the `callback()` if you have multiple pieces to send on.
Alternatively, you may use `callback(err, chunk)` as shorthand for emitting a single chunk or an error.
If you **do not provide a `transformFunction`** then you will get a simple pass-through stream.
### flushFunction
The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress.
```js
fs.createReadStream('/tmp/important.dat')
.pipe(through2(
(chunk, enc, cb) => cb(null, chunk), // transform is a noop
function (cb) { // flush function
this.push('tacking on an extra buffer to the end');
cb();
}
))
.pipe(fs.createWriteStream('/tmp/wut.txt'));
```
<b><code>through2.ctor([ options, ] transformFunction[, flushFunction ])</code></b>
Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances.
```js
var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) {
if (record.temp != null && record.unit == "F") {
record.temp = ( ( record.temp - 32 ) * 5 ) / 9
record.unit = "C"
}
this.push(record)
callback()
})
// Create instances of FToC like so:
var converter = new FToC()
// Or:
var converter = FToC()
// Or specify/override options when you instantiate, if you prefer:
var converter = FToC({objectMode: true})
```
## See Also
- [through2-map](https://github.com/brycebaril/through2-map) - Array.prototype.map analog for streams.
- [through2-filter](https://github.com/brycebaril/through2-filter) - Array.prototype.filter analog for streams.
- [through2-reduce](https://github.com/brycebaril/through2-reduce) - Array.prototype.reduce analog for streams.
- [through2-spy](https://github.com/brycebaril/through2-spy) - Wrapper for simple stream.PassThrough spies.
- the [mississippi stream utility collection](https://github.com/maxogden/mississippi) includes `through2` as well as many more useful stream modules similar to this one
## License
**through2** is Copyright (c) Rod Vagg and additional contributors and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.

View File

@@ -0,0 +1,32 @@
{
"name": "through2",
"version": "3.0.2",
"description": "A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise",
"main": "through2.js",
"scripts": {
"test": "nyc node test/test.js | faucet && nyc report"
},
"repository": {
"type": "git",
"url": "https://github.com/rvagg/through2.git"
},
"keywords": [
"stream",
"streams2",
"through",
"transform"
],
"author": "Rod Vagg <r@va.gg> (https://github.com/rvagg)",
"license": "MIT",
"dependencies": {
"inherits": "^2.0.4",
"readable-stream": "2 || 3"
},
"devDependencies": {
"bl": "~2.0.1",
"faucet": "0.0.1",
"nyc": "~13.1.0",
"stream-spigot": "~3.0.6",
"tape": "~4.9.1"
}
}

View File

@@ -0,0 +1,95 @@
var Transform = require('readable-stream').Transform
, inherits = require('inherits')
function DestroyableTransform(opts) {
Transform.call(this, opts)
this._destroyed = false
}
inherits(DestroyableTransform, Transform)
DestroyableTransform.prototype.destroy = function(err) {
if (this._destroyed) return
this._destroyed = true
var self = this
process.nextTick(function() {
if (err)
self.emit('error', err)
self.emit('close')
})
}
// a noop _transform function
function noop (chunk, enc, callback) {
callback(null, chunk)
}
// create a new export function, used by both the main export and
// the .ctor export, contains common logic for dealing with arguments
function through2 (construct) {
return function (options, transform, flush) {
if (typeof options == 'function') {
flush = transform
transform = options
options = {}
}
if (typeof transform != 'function')
transform = noop
if (typeof flush != 'function')
flush = null
return construct(options, transform, flush)
}
}
// main export, just make me a transform stream!
module.exports = through2(function (options, transform, flush) {
var t2 = new DestroyableTransform(options)
t2._transform = transform
if (flush)
t2._flush = flush
return t2
})
// make me a reusable prototype that I can `new`, or implicitly `new`
// with a constructor call
module.exports.ctor = through2(function (options, transform, flush) {
function Through2 (override) {
if (!(this instanceof Through2))
return new Through2(override)
this.options = Object.assign({}, options, override)
DestroyableTransform.call(this, this.options)
}
inherits(Through2, DestroyableTransform)
Through2.prototype._transform = transform
if (flush)
Through2.prototype._flush = flush
return Through2
})
module.exports.obj = through2(function (options, transform, flush) {
var t2 = new DestroyableTransform(Object.assign({ objectMode: true, highWaterMark: 16 }, options))
t2._transform = transform
if (flush)
t2._flush = flush
return t2
})

View File

@@ -0,0 +1,49 @@
{
"name": "@gulp-sourcemaps/identity-map",
"version": "2.0.1",
"description": "Gulp plugin for generating an identity sourcemap for a file.",
"author": "Gulp-sourcemaps Team",
"contributors": [
"Blaine Bublitz <blaine.bublitz@gmail.com>"
],
"repository": "gulp-sourcemaps/identity-map",
"license": "MIT",
"engines": {
"node": ">= 0.10"
},
"main": "index.js",
"files": [
"LICENSE",
"index.js",
"lib"
],
"scripts": {
"lint": "eslint .",
"pretest": "npm run lint",
"test": "nyc mocha --async-only",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"dependencies": {
"acorn": "^6.4.1",
"normalize-path": "^3.0.0",
"postcss": "^7.0.16",
"source-map": "^0.6.0",
"through2": "^3.0.1"
},
"devDependencies": {
"coveralls": "^3.0.3",
"eslint": "^5.16.0",
"eslint-config-gulp": "^3.0.1",
"expect": "^1.19.0",
"mississippi": "^4.0.0",
"mocha": "^6.1.4",
"nyc": "^14.1.0",
"vinyl": "^2.2.0"
},
"keywords": [
"sourcemap",
"identity",
"generate",
"stream"
]
}

21
node_modules/@gulp-sourcemaps/map-sources/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2017 Blaine Bublitz <blaine.bublitz@gmail.com>
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.

52
node_modules/@gulp-sourcemaps/map-sources/README.md generated vendored Normal file
View File

@@ -0,0 +1,52 @@
# @gulp-sourcemaps/map-sources
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url]
Gulp plugin for mapping sources of a sourcemap.
## Example
```js
var mapSources = require('@gulp-sourcemaps/map-sources');
gulp.src(...)
.pipe(sourcemaps.init())
.pipe(mapSources(function(sourcePath, file) {
return '../' + sourcePath;
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest(...))
```
## API
### `mapSources(mapFn)`
Takes a map function as the only argument. Returns an `objectMode` Transform stream.
#### `mapFn(sourcePath, file)`
The map function is called once per value of the `sources` array of a `sourceMap` attached to each [`Vinyl`][vinyl-url] object passed through the stream. The map function is called with the `sourcePath` string from the `sources` array and the `file` object it originated from. The return value replaces the original value in the array.
If a `Vinyl` object doesn't have a `sourceMap` or `sourceMap.sources` property, the file is passed through the stream without having the `mapFn` called.
All `sources` are normalized to use `/` instead of `\\` as path separators.
## License
MIT
[vinyl-url]: https://github.com/gulpjs/vinyl
[downloads-image]: http://img.shields.io/npm/dm/@gulp-sourcemaps/map-sources.svg
[npm-url]: https://npmjs.org/package/@gulp-sourcemaps/map-sources
[npm-image]: http://img.shields.io/npm/v/@gulp-sourcemaps/map-sources.svg
[travis-url]: https://travis-ci.org/gulp-sourcemaps/map-sources
[travis-image]: http://img.shields.io/travis/gulp-sourcemaps/map-sources.svg?label=travis-ci
[appveyor-url]: https://ci.appveyor.com/project/phated/map-sources
[appveyor-image]: https://img.shields.io/appveyor/ci/phated/map-sources.svg?label=appveyor
[coveralls-url]: https://coveralls.io/r/gulp-sourcemaps/map-sources
[coveralls-image]: http://img.shields.io/coveralls/gulp-sourcemaps/map-sources.svg

30
node_modules/@gulp-sourcemaps/map-sources/index.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
'use strict';
var through = require('through2');
var normalize = require('normalize-path');
function mapSources(mapFn) {
function transform(file, _, cb) {
if (!file.sourceMap || !file.sourceMap.sources) {
return cb(null, file);
}
function mapper(sourcePath) {
var result = sourcePath;
if (typeof mapFn === 'function') {
result = mapFn(sourcePath, file);
}
return normalize(result);
}
file.sourceMap.sources = file.sourceMap.sources.map(mapper);
cb(null, file);
}
return through.obj(transform);
}
module.exports = mapSources;

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014-2017, Jon Schlinkert
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.

View File

@@ -0,0 +1,92 @@
# normalize-path [![NPM version](https://img.shields.io/npm/v/normalize-path.svg?style=flat)](https://www.npmjs.com/package/normalize-path) [![NPM monthly downloads](https://img.shields.io/npm/dm/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![NPM total downloads](https://img.shields.io/npm/dt/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/normalize-path.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/normalize-path)
> Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes unless disabled.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save normalize-path
```
## Usage
```js
var normalize = require('normalize-path');
normalize('\\foo\\bar\\baz\\');
//=> '/foo/bar/baz'
normalize('./foo/bar/baz/');
//=> './foo/bar/baz'
```
Pass `false` as the last argument to **keep** trailing slashes:
```js
normalize('./foo/bar/baz/', false);
//=> './foo/bar/baz/'
normalize('foo\\bar\\baz\\', false);
//=> 'foo/bar/baz/'
```
## About
### Related projects
* [contains-path](https://www.npmjs.com/package/contains-path): Return true if a file path contains the given path. | [homepage](https://github.com/jonschlinkert/contains-path "Return true if a file path contains the given path.")
* [ends-with](https://www.npmjs.com/package/ends-with): Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for… [more](https://github.com/jonschlinkert/ends-with) | [homepage](https://github.com/jonschlinkert/ends-with "Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for comparisons.")
* [is-absolute](https://www.npmjs.com/package/is-absolute): Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute. | [homepage](https://github.com/jonschlinkert/is-absolute "Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute.")
* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.")
* [parse-filepath](https://www.npmjs.com/package/parse-filepath): Pollyfill for node.js `path.parse`, parses a filepath into an object. | [homepage](https://github.com/jonschlinkert/parse-filepath "Pollyfill for node.js `path.parse`, parses a filepath into an object.")
* [path-ends-with](https://www.npmjs.com/package/path-ends-with): Return `true` if a file path ends with the given string/suffix. | [homepage](https://github.com/jonschlinkert/path-ends-with "Return `true` if a file path ends with the given string/suffix.")
* [path-segments](https://www.npmjs.com/package/path-segments): Get n specific segments of a file path, e.g. first 2, last 3, etc. | [homepage](https://github.com/jonschlinkert/path-segments "Get n specific segments of a file path, e.g. first 2, last 3, etc.")
* [rewrite-ext](https://www.npmjs.com/package/rewrite-ext): Automatically re-write the destination extension of a filepath based on the source extension. e.g… [more](https://github.com/jonschlinkert/rewrite-ext) | [homepage](https://github.com/jonschlinkert/rewrite-ext "Automatically re-write the destination extension of a filepath based on the source extension. e.g `.coffee` => `.js`. This will only rename the ext, no other path parts are modified.")
* [unixify](https://www.npmjs.com/package/unixify): Convert Windows file paths to unix paths. | [homepage](https://github.com/jonschlinkert/unixify "Convert Windows file paths to unix paths.")
### Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
### Contributors
| **Commits** | **Contributor** |
| --- | --- |
| 31 | [jonschlinkert](https://github.com/jonschlinkert) |
| 1 | [phated](https://github.com/phated) |
### Building docs
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
To generate the readme, run the following command:
```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```
### Running tests
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
$ npm install && npm test
```
### Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
### License
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 29, 2017._

View File

@@ -0,0 +1,19 @@
/*!
* normalize-path <https://github.com/jonschlinkert/normalize-path>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
var removeTrailingSeparator = require('remove-trailing-separator');
module.exports = function normalizePath(str, stripTrailing) {
if (typeof str !== 'string') {
throw new TypeError('expected a string');
}
str = str.replace(/[\\\/]+/g, '/');
if (stripTrailing !== false) {
str = removeTrailingSeparator(str);
}
return str;
};

View File

@@ -0,0 +1,78 @@
{
"name": "normalize-path",
"description": "Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes unless disabled.",
"version": "2.1.1",
"homepage": "https://github.com/jonschlinkert/normalize-path",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
"Blaine Bublitz <blaine.bublitz@gmail.com> (https://twitter.com/BlaineBublitz)",
"Jon Schlinkert <jon.schlinkert@sellside.com> (http://twitter.com/jonschlinkert)"
],
"repository": "jonschlinkert/normalize-path",
"bugs": {
"url": "https://github.com/jonschlinkert/normalize-path/issues"
},
"license": "MIT",
"files": [
"index.js"
],
"main": "index.js",
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "mocha"
},
"dependencies": {
"remove-trailing-separator": "^1.0.1"
},
"devDependencies": {
"benchmarked": "^0.1.1",
"gulp-format-md": "^0.1.11",
"minimist": "^1.2.0",
"mocha": "*"
},
"keywords": [
"backslash",
"file",
"filepath",
"fix",
"forward",
"fp",
"fs",
"normalize",
"path",
"slash",
"slashes",
"trailing",
"unix",
"urix"
],
"verb": {
"related": {
"list": [
"contains-path",
"ends-with",
"is-absolute",
"is-relative",
"parse-filepath",
"path-ends-with",
"path-segments",
"rewrite-ext",
"unixify"
],
"description": "Other useful libraries for working with paths in node.js:"
},
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"plugins": [
"gulp-format-md"
],
"lint": {
"reflinks": true
}
}
}

View File

@@ -0,0 +1,9 @@
# The MIT License (MIT)
**Copyright (c) Rod Vagg (the "Original Author") and additional 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.

View File

@@ -0,0 +1,134 @@
# through2
[![NPM](https://nodei.co/npm/through2.png?downloads&downloadRank)](https://nodei.co/npm/through2/)
**A tiny wrapper around Node streams.Transform (Streams2/3) to avoid explicit subclassing noise**
Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`.
Note: As 2.x.x this module starts using **Streams3** instead of Stream2. To continue using a Streams2 version use `npm install through2@0` to fetch the latest version of 0.x.x. More information about Streams2 vs Streams3 and recommendations see the article **[Why I don't use Node's core 'stream' module](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html)**.
```js
fs.createReadStream('ex.txt')
.pipe(through2(function (chunk, enc, callback) {
for (var i = 0; i < chunk.length; i++)
if (chunk[i] == 97)
chunk[i] = 122 // swap 'a' for 'z'
this.push(chunk)
callback()
}))
.pipe(fs.createWriteStream('out.txt'))
.on('finish', () => doSomethingSpecial())
```
Or object streams:
```js
var all = []
fs.createReadStream('data.csv')
.pipe(csv2())
.pipe(through2.obj(function (chunk, enc, callback) {
var data = {
name : chunk[0]
, address : chunk[3]
, phone : chunk[10]
}
this.push(data)
callback()
}))
.on('data', (data) => {
all.push(data)
})
.on('end', () => {
doSomethingSpecial(all)
})
```
Note that `through2.obj(fn)` is a convenience wrapper around `through2({ objectMode: true }, fn)`.
## API
<b><code>through2([ options, ] [ transformFunction ] [, flushFunction ])</code></b>
Consult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`).
### options
The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams (or just use `through2.obj()`).
The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call:
```js
fs.createReadStream('/tmp/important.dat')
.pipe(through2({ objectMode: true, allowHalfOpen: false },
(chunk, enc, cb) => {
cb(null, 'wut?') // note we can use the second argument on the callback
// to provide data as an alternative to this.push('wut?')
}
)
.pipe(fs.createWriteStream('/tmp/wut.txt'))
```
### transformFunction
The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk.
To queue a new chunk, call `this.push(chunk)`&mdash;this can be called as many times as required before the `callback()` if you have multiple pieces to send on.
Alternatively, you may use `callback(err, chunk)` as shorthand for emitting a single chunk or an error.
If you **do not provide a `transformFunction`** then you will get a simple pass-through stream.
### flushFunction
The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress.
```js
fs.createReadStream('/tmp/important.dat')
.pipe(through2(
(chunk, enc, cb) => cb(null, chunk), // transform is a noop
function (cb) { // flush function
this.push('tacking on an extra buffer to the end');
cb();
}
))
.pipe(fs.createWriteStream('/tmp/wut.txt'));
```
<b><code>through2.ctor([ options, ] transformFunction[, flushFunction ])</code></b>
Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances.
```js
var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) {
if (record.temp != null && record.unit == "F") {
record.temp = ( ( record.temp - 32 ) * 5 ) / 9
record.unit = "C"
}
this.push(record)
callback()
})
// Create instances of FToC like so:
var converter = new FToC()
// Or:
var converter = FToC()
// Or specify/override options when you instantiate, if you prefer:
var converter = FToC({objectMode: true})
```
## See Also
- [through2-map](https://github.com/brycebaril/through2-map) - Array.prototype.map analog for streams.
- [through2-filter](https://github.com/brycebaril/through2-filter) - Array.prototype.filter analog for streams.
- [through2-reduce](https://github.com/brycebaril/through2-reduce) - Array.prototype.reduce analog for streams.
- [through2-spy](https://github.com/brycebaril/through2-spy) - Wrapper for simple stream.PassThrough spies.
- the [mississippi stream utility collection](https://github.com/maxogden/mississippi) includes `through2` as well as many more useful stream modules similar to this one
## License
**through2** is Copyright (c) Rod Vagg [@rvagg](https://twitter.com/rvagg) and additional contributors and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.

View File

@@ -0,0 +1,33 @@
{
"name": "through2",
"version": "2.0.5",
"description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise",
"main": "through2.js",
"scripts": {
"test": "node test/test.js | faucet"
},
"repository": {
"type": "git",
"url": "https://github.com/rvagg/through2.git"
},
"keywords": [
"stream",
"streams2",
"through",
"transform"
],
"author": "Rod Vagg <r@va.gg> (https://github.com/rvagg)",
"license": "MIT",
"dependencies": {
"readable-stream": "~2.3.6",
"xtend": "~4.0.1"
},
"devDependencies": {
"bl": "~2.0.1",
"faucet": "0.0.1",
"nyc": "~13.1.0",
"safe-buffer": "~5.1.2",
"stream-spigot": "~3.0.6",
"tape": "~4.9.1"
}
}

View File

@@ -0,0 +1,96 @@
var Transform = require('readable-stream').Transform
, inherits = require('util').inherits
, xtend = require('xtend')
function DestroyableTransform(opts) {
Transform.call(this, opts)
this._destroyed = false
}
inherits(DestroyableTransform, Transform)
DestroyableTransform.prototype.destroy = function(err) {
if (this._destroyed) return
this._destroyed = true
var self = this
process.nextTick(function() {
if (err)
self.emit('error', err)
self.emit('close')
})
}
// a noop _transform function
function noop (chunk, enc, callback) {
callback(null, chunk)
}
// create a new export function, used by both the main export and
// the .ctor export, contains common logic for dealing with arguments
function through2 (construct) {
return function (options, transform, flush) {
if (typeof options == 'function') {
flush = transform
transform = options
options = {}
}
if (typeof transform != 'function')
transform = noop
if (typeof flush != 'function')
flush = null
return construct(options, transform, flush)
}
}
// main export, just make me a transform stream!
module.exports = through2(function (options, transform, flush) {
var t2 = new DestroyableTransform(options)
t2._transform = transform
if (flush)
t2._flush = flush
return t2
})
// make me a reusable prototype that I can `new`, or implicitly `new`
// with a constructor call
module.exports.ctor = through2(function (options, transform, flush) {
function Through2 (override) {
if (!(this instanceof Through2))
return new Through2(override)
this.options = xtend(options, override)
DestroyableTransform.call(this, this.options)
}
inherits(Through2, DestroyableTransform)
Through2.prototype._transform = transform
if (flush)
Through2.prototype._flush = flush
return Through2
})
module.exports.obj = through2(function (options, transform, flush) {
var t2 = new DestroyableTransform(xtend({ objectMode: true, highWaterMark: 16 }, options))
t2._transform = transform
if (flush)
t2._flush = flush
return t2
})

47
node_modules/@gulp-sourcemaps/map-sources/package.json generated vendored Normal file
View File

@@ -0,0 +1,47 @@
{
"name": "@gulp-sourcemaps/map-sources",
"version": "1.0.0",
"description": "Gulp plugin for mapping sources of a sourcemap.",
"author": "Gulp-sourcemaps Team",
"contributors": [
"Blaine Bublitz <blaine.bublitz@gmail.com>"
],
"repository": "gulp-sourcemaps/map-sources",
"license": "MIT",
"engines": {
"node": ">= 0.10"
},
"main": "index.js",
"files": [
"LICENSE",
"index.js"
],
"scripts": {
"lint": "eslint . && jscs index.js test/",
"pretest": "npm run lint",
"test": "mocha --async-only",
"cover": "istanbul cover _mocha --report lcovonly",
"coveralls": "npm run cover && istanbul-coveralls"
},
"dependencies": {
"normalize-path": "^2.0.1",
"through2": "^2.0.3"
},
"devDependencies": {
"eslint": "^1.7.3",
"eslint-config-gulp": "^2.0.0",
"expect": "^1.19.0",
"istanbul": "^0.4.3",
"istanbul-coveralls": "^1.0.3",
"jscs": "^2.3.5",
"jscs-preset-gulp": "^1.0.0",
"mississippi": "^1.3.0",
"mocha": "^2.4.5",
"vinyl": "^2.0.1"
},
"keywords": [
"sourcemap",
"sources",
"stream"
]
}

550
node_modules/acorn/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,550 @@
## 6.4.0 (2019-11-26)
### New features
Add a static `acorn` property to the `Parser` class that contains the entire module interface, to allow plugins to access the instance of the library that they are acting on.
## 6.3.0 (2019-08-12)
### New features
`sourceType: "module"` can now be used even when `ecmaVersion` is less than 6, to parse module-style code that otherwise conforms to an older standard.
## 6.2.1 (2019-07-21)
### Bug fixes
Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such.
Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances.
## 6.2.0 (2019-07-04)
### Bug fixes
Improve valid assignment checking in `for`/`in` and `for`/`of` loops.
Disallow binding `let` in patterns.
### New features
Support bigint syntax with `ecmaVersion` >= 10.
Support dynamic `import` syntax with `ecmaVersion` >= 10.
Upgrade to Unicode version 12.
## 6.1.1 (2019-02-27)
### Bug fixes
Fix bug that caused parsing default exports of with names to fail.
## 6.1.0 (2019-02-08)
### Bug fixes
Fix scope checking when redefining a `var` as a lexical binding.
### New features
Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins.
## 6.0.7 (2019-02-04)
### Bug fixes
Check that exported bindings are defined.
Don't treat `\u180e` as a whitespace character.
Check for duplicate parameter names in methods.
Don't allow shorthand properties when they are generators or async methods.
Forbid binding `await` in async arrow function's parameter list.
## 6.0.6 (2019-01-30)
### Bug fixes
The content of class declarations and expressions is now always parsed in strict mode.
Don't allow `let` or `const` to bind the variable name `let`.
Treat class declarations as lexical.
Don't allow a generator function declaration as the sole body of an `if` or `else`.
Ignore `"use strict"` when after an empty statement.
Allow string line continuations with special line terminator characters.
Treat `for` bodies as part of the `for` scope when checking for conflicting bindings.
Fix bug with parsing `yield` in a `for` loop initializer.
Implement special cases around scope checking for functions.
## 6.0.5 (2019-01-02)
### Bug fixes
Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type.
Don't treat `let` as a keyword when the next token is `{` on the next line.
Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on.
## 6.0.4 (2018-11-05)
### Bug fixes
Further improvements to tokenizing regular expressions in corner cases.
## 6.0.3 (2018-11-04)
### Bug fixes
Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression.
Remove stray symlink in the package tarball.
## 6.0.2 (2018-09-26)
### Bug fixes
Fix bug where default expressions could fail to parse inside an object destructuring assignment expression.
## 6.0.1 (2018-09-14)
### Bug fixes
Fix wrong value in `version` export.
## 6.0.0 (2018-09-14)
### Bug fixes
Better handle variable-redefinition checks for catch bindings and functions directly under if statements.
Forbid `new.target` in top-level arrow functions.
Fix issue with parsing a regexp after `yield` in some contexts.
### New features
The package now comes with TypeScript definitions.
### Breaking changes
The default value of the `ecmaVersion` option is now 9 (2018).
Plugins work differently, and will have to be rewritten to work with this version.
The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`).
## 5.7.3 (2018-09-10)
### Bug fixes
Fix failure to tokenize regexps after expressions like `x.of`.
Better error message for unterminated template literals.
## 5.7.2 (2018-08-24)
### Bug fixes
Properly handle `allowAwaitOutsideFunction` in for statements.
Treat function declarations at the top level of modules like let bindings.
Don't allow async function declarations as the only statement under a label.
## 5.7.0 (2018-06-15)
### New features
Upgraded to Unicode 11.
## 5.6.0 (2018-05-31)
### New features
Allow U+2028 and U+2029 in string when ECMAVersion >= 10.
Allow binding-less catch statements when ECMAVersion >= 10.
Add `allowAwaitOutsideFunction` option for parsing top-level `await`.
## 5.5.3 (2018-03-08)
### Bug fixes
A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps.
## 5.5.2 (2018-03-08)
### Bug fixes
A republish of the code in 5.5.1 in an attempt to solve an issue with the file timestamps in the npm package being 0.
## 5.5.1 (2018-03-06)
### Bug fixes
Fix misleading error message for octal escapes in template strings.
## 5.5.0 (2018-02-27)
### New features
The identifier character categorization is now based on Unicode version 10.
Acorn will now validate the content of regular expressions, including new ES9 features.
## 5.4.0 (2018-02-01)
### Bug fixes
Disallow duplicate or escaped flags on regular expressions.
Disallow octal escapes in strings in strict mode.
### New features
Add support for async iteration.
Add support for object spread and rest.
## 5.3.0 (2017-12-28)
### Bug fixes
Fix parsing of floating point literals with leading zeroes in loose mode.
Allow duplicate property names in object patterns.
Don't allow static class methods named `prototype`.
Disallow async functions directly under `if` or `else`.
Parse right-hand-side of `for`/`of` as an assignment expression.
Stricter parsing of `for`/`in`.
Don't allow unicode escapes in contextual keywords.
### New features
Parsing class members was factored into smaller methods to allow plugins to hook into it.
## 5.2.1 (2017-10-30)
### Bug fixes
Fix a token context corruption bug.
## 5.2.0 (2017-10-30)
### Bug fixes
Fix token context tracking for `class` and `function` in property-name position.
Make sure `%*` isn't parsed as a valid operator.
Allow shorthand properties `get` and `set` to be followed by default values.
Disallow `super` when not in callee or object position.
### New features
Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements.
## 5.1.2 (2017-09-04)
### Bug fixes
Disable parsing of legacy HTML-style comments in modules.
Fix parsing of async methods whose names are keywords.
## 5.1.1 (2017-07-06)
### Bug fixes
Fix problem with disambiguating regexp and division after a class.
## 5.1.0 (2017-07-05)
### Bug fixes
Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`.
Parse zero-prefixed numbers with non-octal digits as decimal.
Allow object/array patterns in rest parameters.
Don't error when `yield` is used as a property name.
Allow `async` as a shorthand object property.
### New features
Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9.
## 5.0.3 (2017-04-01)
### Bug fixes
Fix spurious duplicate variable definition errors for named functions.
## 5.0.2 (2017-03-30)
### Bug fixes
A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error.
## 5.0.0 (2017-03-28)
### Bug fixes
Raise an error for duplicated lexical bindings.
Fix spurious error when an assignement expression occurred after a spread expression.
Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions.
Allow labels in front or `var` declarations, even in strict mode.
### Breaking changes
Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`.
## 4.0.11 (2017-02-07)
### Bug fixes
Allow all forms of member expressions to be parenthesized as lvalue.
## 4.0.10 (2017-02-07)
### Bug fixes
Don't expect semicolons after default-exported functions or classes, even when they are expressions.
Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode.
## 4.0.9 (2017-02-06)
### Bug fixes
Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again.
## 4.0.8 (2017-02-03)
### Bug fixes
Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet.
## 4.0.7 (2017-02-02)
### Bug fixes
Accept invalidly rejected code like `(x).y = 2` again.
Don't raise an error when a function _inside_ strict code has a non-simple parameter list.
## 4.0.6 (2017-02-02)
### Bug fixes
Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check.
## 4.0.5 (2017-02-02)
### Bug fixes
Disallow parenthesized pattern expressions.
Allow keywords as export names.
Don't allow the `async` keyword to be parenthesized.
Properly raise an error when a keyword contains a character escape.
Allow `"use strict"` to appear after other string literal expressions.
Disallow labeled declarations.
## 4.0.4 (2016-12-19)
### Bug fixes
Fix crash when `export` was followed by a keyword that can't be
exported.
## 4.0.3 (2016-08-16)
### Bug fixes
Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode.
Properly parse properties named `async` in ES2017 mode.
Fix bug where reserved words were broken in ES2017 mode.
## 4.0.2 (2016-08-11)
### Bug fixes
Don't ignore period or 'e' characters after octal numbers.
Fix broken parsing for call expressions in default parameter values of arrow functions.
## 4.0.1 (2016-08-08)
### Bug fixes
Fix false positives in duplicated export name errors.
## 4.0.0 (2016-08-07)
### Breaking changes
The default `ecmaVersion` option value is now 7.
A number of internal method signatures changed, so plugins might need to be updated.
### Bug fixes
The parser now raises errors on duplicated export names.
`arguments` and `eval` can now be used in shorthand properties.
Duplicate parameter names in non-simple argument lists now always produce an error.
### New features
The `ecmaVersion` option now also accepts year-style version numbers
(2015, etc).
Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
Support for trailing commas in call expressions when `ecmaVersion` is >= 8.
## 3.3.0 (2016-07-25)
### Bug fixes
Fix bug in tokenizing of regexp operator after a function declaration.
Fix parser crash when parsing an array pattern with a hole.
### New features
Implement check against complex argument lists in functions that enable strict mode in ES7.
## 3.2.0 (2016-06-07)
### Bug fixes
Improve handling of lack of unicode regexp support in host
environment.
Properly reject shorthand properties whose name is a keyword.
### New features
Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object.
## 3.1.0 (2016-04-18)
### Bug fixes
Properly tokenize the division operator directly after a function expression.
Allow trailing comma in destructuring arrays.
## 3.0.4 (2016-02-25)
### Fixes
Allow update expressions as left-hand-side of the ES7 exponential operator.
## 3.0.2 (2016-02-10)
### Fixes
Fix bug that accidentally made `undefined` a reserved word when parsing ES7.
## 3.0.0 (2016-02-10)
### Breaking changes
The default value of the `ecmaVersion` option is now 6 (used to be 5).
Support for comprehension syntax (which was dropped from the draft spec) has been removed.
### Fixes
`let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code.
A parenthesized class or function expression after `export default` is now parsed correctly.
### New features
When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`).
The identifier character ranges are now based on Unicode 8.0.0.
Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled.
## 2.7.0 (2016-01-04)
### Fixes
Stop allowing rest parameters in setters.
Disallow `y` rexexp flag in ES5.
Disallow `\00` and `\000` escapes in strict mode.
Raise an error when an import name is a reserved word.
## 2.6.2 (2015-11-10)
### Fixes
Don't crash when no options object is passed.
## 2.6.0 (2015-11-09)
### Fixes
Add `await` as a reserved word in module sources.
Disallow `yield` in a parameter default value for a generator.
Forbid using a comma after a rest pattern in an array destructuring.
### New features
Support parsing stdin in command-line tool.
## 2.5.0 (2015-10-27)
### Fixes
Fix tokenizer support in the command-line tool.
Stop allowing `new.target` outside of functions.
Remove legacy `guard` and `guardedHandler` properties from try nodes.
Stop allowing multiple `__proto__` properties on an object literal in strict mode.
Don't allow rest parameters to be non-identifier patterns.
Check for duplicate paramter names in arrow functions.

19
node_modules/acorn/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,19 @@
Copyright (C) 2012-2018 by various contributors (see AUTHORS)
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.

269
node_modules/acorn/README.md generated vendored Normal file
View File

@@ -0,0 +1,269 @@
# Acorn
A tiny, fast JavaScript parser written in JavaScript.
## Community
Acorn is open source software released under an
[MIT license](https://github.com/acornjs/acorn/blob/master/acorn/LICENSE).
You are welcome to
[report bugs](https://github.com/acornjs/acorn/issues) or create pull
requests on [github](https://github.com/acornjs/acorn). For questions
and discussion, please use the
[Tern discussion forum](https://discuss.ternjs.net).
## Installation
The easiest way to install acorn is from [`npm`](https://www.npmjs.com/):
```sh
npm install acorn
```
Alternately, you can download the source and build acorn yourself:
```sh
git clone https://github.com/acornjs/acorn.git
cd acorn
npm install
```
## Interface
**parse**`(input, options)` is the main interface to the library. The
`input` parameter is a string, `options` can be undefined or an object
setting some of the options listed below. The return value will be an
abstract syntax tree object as specified by the [ESTree
spec](https://github.com/estree/estree).
```javascript
let acorn = require("acorn");
console.log(acorn.parse("1 + 1"));
```
When encountering a syntax error, the parser will raise a
`SyntaxError` object with a meaningful message. The error object will
have a `pos` property that indicates the string offset at which the
error occurred, and a `loc` object that contains a `{line, column}`
object referring to that same position.
Options can be provided by passing a second argument, which should be
an object containing any of these fields:
- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be
either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018) or 10 (2019, partial
support). This influences support for strict mode, the set of
reserved words, and support for new syntax features. Default is 9.
**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
implemented by Acorn. Other proposed new features can be implemented
through plugins.
- **sourceType**: Indicate the mode the code should be parsed in. Can be
either `"script"` or `"module"`. This influences global strict mode
and parsing of `import` and `export` declarations.
**NOTE**: If set to `"module"`, then static `import` / `export` syntax
will be valid, even if `ecmaVersion` is less than 6.
- **onInsertedSemicolon**: If given a callback, that callback will be
called whenever a missing semicolon is inserted by the parser. The
callback will be given the character offset of the point where the
semicolon is inserted as argument, and if `locations` is on, also a
`{line, column}` object representing this position.
- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing
commas.
- **allowReserved**: If `false`, using a reserved word will generate
an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher
versions. When given the value `"never"`, reserved words and
keywords can also not be used as property names (as in Internet
Explorer's old parser).
- **allowReturnOutsideFunction**: By default, a return statement at
the top level raises an error. Set this to `true` to accept such
code.
- **allowImportExportEverywhere**: By default, `import` and `export`
declarations can only appear at a program's top level. Setting this
option to `true` allows them anywhere where a statement is allowed.
- **allowAwaitOutsideFunction**: By default, `await` expressions can
only appear inside `async` functions. Setting this option to
`true` allows to have top-level `await` expressions. They are
still not allowed in non-`async` functions, though.
- **allowHashBang**: When this is enabled (off by default), if the
code starts with the characters `#!` (as in a shellscript), the
first line will be treated as a comment.
- **locations**: When `true`, each node has a `loc` object attached
with `start` and `end` subobjects, each of which contains the
one-based line and zero-based column numbers in `{line, column}`
form. Default is `false`.
- **onToken**: If a function is passed for this option, each found
token will be passed in same format as tokens returned from
`tokenizer().getToken()`.
If array is passed, each found token is pushed to it.
Note that you are not allowed to call the parser from the
callback—that will corrupt its internal state.
- **onComment**: If a function is passed for this option, whenever a
comment is encountered the function will be called with the
following parameters:
- `block`: `true` if the comment is a block comment, false if it
is a line comment.
- `text`: The content of the comment.
- `start`: Character offset of the start of the comment.
- `end`: Character offset of the end of the comment.
When the `locations` options is on, the `{line, column}` locations
of the comments start and end are passed as two additional
parameters.
If array is passed for this option, each found comment is pushed
to it as object in Esprima format:
```javascript
{
"type": "Line" | "Block",
"value": "comment text",
"start": Number,
"end": Number,
// If `locations` option is on:
"loc": {
"start": {line: Number, column: Number}
"end": {line: Number, column: Number}
},
// If `ranges` option is on:
"range": [Number, Number]
}
```
Note that you are not allowed to call the parser from the
callback—that will corrupt its internal state.
- **ranges**: Nodes have their start and end characters offsets
recorded in `start` and `end` properties (directly on the node,
rather than the `loc` object, which holds line/column data. To also
add a
[semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678)
`range` property holding a `[start, end]` array with the same
numbers, set the `ranges` option to `true`.
- **program**: It is possible to parse multiple files into a single
AST by passing the tree produced by parsing the first file as the
`program` option in subsequent parses. This will add the toplevel
forms of the parsed file to the "Program" (top) node of an existing
parse tree.
- **sourceFile**: When the `locations` option is `true`, you can pass
this option to add a `source` attribute in every nodes `loc`
object. Note that the contents of this option are not examined or
processed in any way; you are free to use whatever format you
choose.
- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property
will be added (regardless of the `location` option) directly to the
nodes, rather than the `loc` object.
- **preserveParens**: If this option is `true`, parenthesized expressions
are represented by (non-standard) `ParenthesizedExpression` nodes
that have a single `expression` property containing the expression
inside parentheses.
**parseExpressionAt**`(input, offset, options)` will parse a single
expression in a string, and return its AST. It will not complain if
there is more of the string left after the expression.
**tokenizer**`(input, options)` returns an object with a `getToken`
method that can be called repeatedly to get the next token, a `{start,
end, type, value}` object (with added `loc` property when the
`locations` option is enabled and `range` property when the `ranges`
option is enabled). When the token's type is `tokTypes.eof`, you
should stop calling the method, since it will keep returning that same
token forever.
In ES6 environment, returned result can be used as any other
protocol-compliant iterable:
```javascript
for (let token of acorn.tokenizer(str)) {
// iterate over the tokens
}
// transform code to array of tokens:
var tokens = [...acorn.tokenizer(str)];
```
**tokTypes** holds an object mapping names to the token type objects
that end up in the `type` properties of tokens.
**getLineInfo**`(input, offset)` can be used to get a `{line,
column}` object for a given program string and offset.
### The `Parser` class
Instances of the **`Parser`** class contain all the state and logic
that drives a parse. It has static methods `parse`,
`parseExpressionAt`, and `tokenizer` that match the top-level
functions by the same name.
When extending the parser with plugins, you need to call these methods
on the extended version of the class. To extend a parser with plugins,
you can use its static `extend` method.
```javascript
var acorn = require("acorn");
var jsx = require("acorn-jsx");
var JSXParser = acorn.Parser.extend(jsx());
JSXParser.parse("foo(<bar/>)");
```
The `extend` method takes any number of plugin values, and returns a
new `Parser` class that includes the extra parser logic provided by
the plugins.
## Command line interface
The `bin/acorn` utility can be used to parse a file from the command
line. It accepts as arguments its input file and the following
options:
- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version
to parse. Default is version 9.
- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise.
- `--locations`: Attaches a "loc" object to each node with "start" and
"end" subobjects, each of which contains the one-based line and
zero-based column numbers in `{line, column}` form.
- `--allow-hash-bang`: If the code starts with the characters #! (as
in a shellscript), the first line will be treated as a comment.
- `--compact`: No whitespace is used in the AST output.
- `--silent`: Do not output the AST, just return the exit status.
- `--help`: Print the usage information and quit.
The utility spits out the syntax tree as JSON data.
## Existing plugins
- [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx)
Plugins for ECMAScript proposals:
- [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling:
- [`acorn-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields)
- [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta)
- [`acorn-numeric-separator`](https://github.com/acornjs/acorn-numeric-separator): Parse [numeric separator proposal](https://github.com/tc39/proposal-numeric-separator)
- [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods)n

4
node_modules/acorn/bin/acorn generated vendored Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env node
'use strict';
require('../dist/bin.js');

Some files were not shown because too many files have changed in this diff Show More