diff --git a/.angular-cli.json b/.angular-cli.json index b3bb50f134..2bcfa98539 100644 --- a/.angular-cli.json +++ b/.angular-cli.json @@ -6,49 +6,39 @@ "apps": [ { "name": "lib", - "root": "lib", + "root": "src/lib", "outDir": "dist", - "assets": [ - "assets" - ], - "index": "test/index.html", - "main": "test/main.ts", - "polyfills": "test/polyfills.ts", - "test": "test/test.ts", + "assets": [], + "index": "../demo-app/index.html", + "main": "../demo-app/main.ts", + "polyfills": "../demo-app/polyfills.ts", + "test": "../test/test.ts", "tsconfig": "tsconfig.lib.json", - "testTsconfig": "tsconfig.spec.json", + "testTsconfig": "../tsconfig.spec.json", "prefix": "igo", "mobile": true, "styles": [], - "scripts": [], - "environmentSource": "environments/environment.ts", - "environments": { - "dev": "environments/environment.ts", - "prod": "environments/environment.prod.ts" - } + "scripts": [] }, { "name": "demo", - "root": "demo-app", + "root": "src/demo-app", "outDir": "dist", "assets": [ - "assets", - "locale" + "assets" ], "index": "index.html", "main": "main.ts", "polyfills": "polyfills.ts", - "test": "test.ts", - "tsconfig": "tsconfig.app.json", - "testTsconfig": "tsconfig.spec.json", - "prefix": "igo", + "tsconfig": "tsconfig.demo.json", + "prefix": "demo", "mobile": true, "styles": [ - "../node_modules/openlayers/dist/ol.css", + "../../node_modules/openlayers/dist/ol.css", "css/styles.styl" ], "scripts": [ - "../node_modules/openlayers/dist/ol.js" + "../../node_modules/openlayers/dist/ol.js" ], "environmentSource": "environments/environment.ts", "environments": { @@ -67,19 +57,15 @@ }, "lint": [ { - "project": "lib/tsconfig.lib.json", - "exclude": "**/node_modules/**/*" - }, - { - "project": "lib/tsconfig.spec.json", + "project": "src/lib/tsconfig.lib.json", "exclude": "**/node_modules/**/*" }, { - "project": "demo-app/tsconfig.app.json", + "project": "src/tsconfig.spec.json", "exclude": "**/node_modules/**/*" }, { - "project": "demo-app/tsconfig.spec.json", + "project": "src/demo-app/tsconfig.demo.json", "exclude": "**/node_modules/**/*" }, { @@ -89,7 +75,7 @@ ], "test": { "karma": { - "config": "./karma.lib.conf.js" + "config": "./karma.conf.js" } }, "defaults": { diff --git a/.gitignore b/.gitignore index 2bf1206717..1c5c881815 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,7 @@ # compiled output /dist -/lib/dist -/lib/bundle +/bundle /tmp /out-tsc *.metadata.json diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000000..29e923f99d --- /dev/null +++ b/.npmignore @@ -0,0 +1,26 @@ +/node_modules/ +/guides/ +/e2e/ + +# src +/src/demo-app/ +/src/test/ + +.npmignore +.gitignore +CONTRIBUTING.md +*.tgz + + +# Ignore configurations +*.conf.* +tsconfig*.json +tslint.json +gulpfile.js +.* + +# ignore the .ts files +*.ts + +# include the .d.ts files +!*.d.ts diff --git a/demo-app/assets/.gitkeep b/demo-app/assets/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/demo-app/assets/locale/en.json b/demo-app/assets/locale/en.json deleted file mode 100644 index 2c63c08510..0000000000 --- a/demo-app/assets/locale/en.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} diff --git a/demo-app/assets/locale/fr.json b/demo-app/assets/locale/fr.json deleted file mode 100644 index 0db3279e44..0000000000 --- a/demo-app/assets/locale/fr.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - -} diff --git a/demo-app/assets/locale/template.json b/demo-app/assets/locale/template.json deleted file mode 100644 index 0e0dcd235c..0000000000 --- a/demo-app/assets/locale/template.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - -} \ No newline at end of file diff --git a/demo-app/tsconfig.spec.json b/demo-app/tsconfig.spec.json deleted file mode 100644 index 510e3f1fda..0000000000 --- a/demo-app/tsconfig.spec.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "../out-tsc/spec", - "module": "commonjs", - "target": "es5", - "baseUrl": "", - "types": [ - "jasmine", - "node" - ] - }, - "files": [ - "test.ts" - ], - "include": [ - "**/*.spec.ts", - "**/*.d.ts" - ] -} diff --git a/gulpfile.js b/gulpfile.js index ce3550be8d..90494eabc7 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -4,20 +4,20 @@ var stylus = require('gulp-stylus'); gulp.task('copyHtml', () => { - gulp.src('./lib/src/**/*.html') - .pipe(gulp.dest('./lib/dist')); + gulp.src('./src/lib/**/*.html') + .pipe(gulp.dest('./dist')); }); gulp.task('copyTs', () => { - gulp.src(['./lib/src/**/*.ts', '!./lib/src/**/*.spec.ts']) + gulp.src(['./src/lib/**/*.ts', '!./src/lib/**/*.spec.ts']) .pipe(replace(/styleUrls: \[(\'\.\/|\')(.*?)\.styl\'\]/g, 'styleUrls: [\'$2.css\']')) - .pipe(gulp.dest('./lib/dist')); + .pipe(gulp.dest('./dist')); }); gulp.task('copyStylus', () => { - gulp.src('./lib/src/**/*.styl') + gulp.src('./src/lib/**/*.styl') .pipe(stylus()) - .pipe(gulp.dest('./lib/dist')); + .pipe(gulp.dest('./dist')); }); gulp.task('default', ['copyHtml', 'copyTs', 'copyStylus']); diff --git a/karma.demo.conf.js b/karma.conf.js similarity index 91% rename from karma.demo.conf.js rename to karma.conf.js index 08e772b601..b82344a5c2 100644 --- a/karma.demo.conf.js +++ b/karma.conf.js @@ -18,16 +18,16 @@ module.exports = function (config) { files: [ './node_modules/openlayers/dist/ol.js', { - pattern: './assets/locale/*.json', + pattern: './src/assets/locale/*.json', watched: false, included: false, nocache: false, served: true }, - { pattern: './demo-app/test.ts', watched: false } + { pattern: './src/test/test.ts', watched: false } ], preprocessors: { - './demo-app/test.ts': ['@angular/cli'] + './src/test/test.ts': ['@angular/cli'] }, mime: { 'text/x-typescript': ['ts','tsx'] diff --git a/karma.lib.conf.js b/karma.lib.conf.js deleted file mode 100644 index 3cb6e9ec27..0000000000 --- a/karma.lib.conf.js +++ /dev/null @@ -1,64 +0,0 @@ -// Karma configuration file, see link for more information -// https://karma-runner.github.io/0.13/config/configuration-file.html - -module.exports = function (config) { - config.set({ - basePath: '', - frameworks: ['jasmine', '@angular/cli'], - plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage-istanbul-reporter'), - require('@angular/cli/plugins/karma') - ], - client:{ - clearContext: false // leave Jasmine Spec Runner output visible in browser - }, - files: [ - './node_modules/openlayers/dist/ol.js', - { - pattern: './assets/locale/*.json', - watched: false, - included: false, - nocache: false, - served: true - }, - { pattern: './lib/test/test.ts', watched: false } - ], - preprocessors: { - './lib/test/test.ts': ['@angular/cli'] - }, - mime: { - 'text/x-typescript': ['ts','tsx'] - }, - coverageIstanbulReporter: { - reports: [ 'html', 'lcovonly' ], - fixWebpackSourcePaths: true - }, - angularCli: { - environment: 'dev' - }, - reporters: config.angularCli && config.angularCli.codeCoverage - ? ['progress', 'coverage-istanbul'] - : ['progress', 'kjhtml'], - port: 9876, - colors: true, - logLevel: config.LOG_DEBUG, - autoWatch: true, - browsers: ['Chrome'], - customLaunchers: { - Chrome_travis_ci: { - base: 'Chrome', - flags: ['--no-sandbox'] - } - }, - singleRun: false - }); - - if (process.env.TRAVIS) { - config.browsers = ['Chrome_travis_ci']; - config.singleRun = true; - config.browserNoActivityTimeout = 90000; - } -}; diff --git a/lib/.npmignore b/lib/.npmignore deleted file mode 100644 index f712d425d0..0000000000 --- a/lib/.npmignore +++ /dev/null @@ -1,14 +0,0 @@ -/environments/ -/node_modules/ -/src/ -/test/ - -.npmignore -tsconfig*.json -*.tgz - -# ignore the .ts files -*.ts - -# include the .d.ts files -!*.d.ts diff --git a/lib/README.md b/lib/README.md deleted file mode 100644 index 0038467de3..0000000000 --- a/lib/README.md +++ /dev/null @@ -1 +0,0 @@ -The sources for this package are in the [main Igo repo](https://github.com/infra-geo-ouverte/igo2-lib). Please file issues and pull requests against that repo. diff --git a/lib/assets/locale/en.json b/lib/assets/locale/en.json deleted file mode 100644 index b77273e995..0000000000 --- a/lib/assets/locale/en.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "Alias": "Alias", - "Contexts": "Contexts", - "Date": "Date", - "Description": "Description", - "Edit Context": "Edit Context", - "Edit Layer": "Edit Layer", - "End Date": "End Date", - "Map": "Map", - "Go Back": "Go back", - "Open Menu": "Show menu", - "Close Menu": "Close menu", - "Zoom": "Zoom tool", - "Main menu": "Go back to main menu", - "Add Layers": "Add Layers", - "Directions": "Directions", - "Hide Layer": "Hide Layer", - "Historical Analysis": "Historical Analysis", - "Lower Layer": "Bring layer backward", - "Opacity": "Opacity", - "Print": "Print", - "Private": "Private", - "Properties": "Properties", - "Properties & Map": "Properties & Map", - "Protected": "Protected", - "Public": "Public", - "Measure": "Measure", - "Raise Layer": "Bring layer forward", - "Remove Layer": "Remove this layer from the map", - "Save": "Save", - "Search Results": "Search Results", - "Search for an address or a place": "Search for an address, a place or a layer", - "Search disabled": "The search tool is disabled in this context", - "Show Layer": "Show Layer", - "Start Date": "Start Date", - "Time Analysis": "Time Analysis", - "Title": "Title", - - "noLegendText": "No legend available for this layer", - "titleRequired": "Title is required (minimum 3 characters)." -} diff --git a/lib/assets/locale/fr.json b/lib/assets/locale/fr.json deleted file mode 100644 index c5edb595b7..0000000000 --- a/lib/assets/locale/fr.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "Alias": "Alias", - "Contexts": "Vos contextes", - "Date": "Date", - "Description": "Description", - "Edit Context": "Modifier contexte", - "Edit Layer": "Modifier couche", - "End Date": "Date de fin", - "Map": "Carte", - "Go Back": "Revenir", - "Open Menu": "Afficher le menu", - "Close Menu": "Fermer le menu", - "Zoom": "Outil de zoom", - "Main menu": "Revenir au menu principal", - "Add Layers": "Ajouter des couches", - "Directions": "Itinéraire", - "Hide Layer": "Masquer couche", - "Historical Analysis": "Analyse temporelle", - "Lower Layer": "Descendre la couche", - "Opacity": "Opacité", - "Print": "Impression", - "Private": "Privé", - "Properties": "Propriétés", - "Properties & Map": "Propriétés & Carte", - "Protected": "Protégé", - "Public": "Public", - "Measure": "Mesure", - "Raise Layer": "Monter la couche", - "Remove Layer": "Retirer la couche de la carte", - "Save": "Sauvegarder", - "Search Results": "Résultats de recherche", - "Search for an address or a place": "Rechercher une adresse, un lieu ou une couche", - "Search disabled": "L'outil de recherche est désactivé dans ce contexte", - "Show Layer": "Afficher couche", - "Start Date": "Date de début", - "Time Analysis": "Analyse Temporelle", - "Title": "Titre", - - "noLegendText": "Aucune légende disponible pour cette couche", - "titleRequired": "Un titre est requis (minimum 3 caractères)." -} diff --git a/lib/environments/environment.prod.ts b/lib/environments/environment.prod.ts deleted file mode 100644 index 3612073bc3..0000000000 --- a/lib/environments/environment.prod.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const environment = { - production: true -}; diff --git a/lib/environments/environment.ts b/lib/environments/environment.ts deleted file mode 100644 index b7f639aeca..0000000000 --- a/lib/environments/environment.ts +++ /dev/null @@ -1,8 +0,0 @@ -// The file contents for the current environment will overwrite these during build. -// The build system defaults to the dev environment which uses `environment.ts`, but if you do -// `ng build --env=prod` then `environment.prod.ts` will be used instead. -// The list of which env maps to which file can be found in `.angular-cli.json`. - -export const environment = { - production: false -}; diff --git a/lib/package.json b/lib/package.json deleted file mode 100644 index 2f1577ba04..0000000000 --- a/lib/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "igo2", - "version": "0.0.2", - "description": "IGO Library", - "main": "bundle/igo.js", - "typings": "dist/index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/infra-geo-ouverte/igo2-lib.git" - }, - "keywords": [ - "igo" - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/infra-geo-ouverte/igo2-lib/issues" - }, - "homepage": "https://github.com/infra-geo-ouverte/igo2-lib#readme", - "dependencies": { - "@angular/animations": "^4.0.2", - "@angular/common": "^4.0.0", - "@angular/core": "^4.0.0", - "@angular/forms": "^4.0.0", - "@angular/http": "^4.0.0", - "@angular/material": "git+https://github.com/angular/material2-builds.git", - "md2": "0.0.17-2", - "ng2-translate": "^5.0.0", - "openlayers": "^4.0.1", - "rxjs": "^5.1.0", - "ts-md5": "^1.2.0" - }, - "devDependencies": { - "@types/openlayers": "^4.0.1" - } -} diff --git a/lib/test/index.html b/lib/test/index.html deleted file mode 100644 index 67b6f11fba..0000000000 --- a/lib/test/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - IgoLib - - - - - - -

Igo Lib

- - diff --git a/lib/test/main.ts b/lib/test/main.ts deleted file mode 100644 index 24d85451bd..0000000000 --- a/lib/test/main.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; -import { enableProdMode } from '@angular/core'; -import { environment } from '../environments/environment'; -import { IgoTestModule } from './module'; - -if (environment.production) { - enableProdMode(); -} - -platformBrowserDynamic().bootstrapModule(IgoTestModule); diff --git a/lib/test/polyfills.ts b/lib/test/polyfills.ts deleted file mode 100644 index 53bdaf1b86..0000000000 --- a/lib/test/polyfills.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This file includes polyfills needed by Angular and is loaded before the app. - * You can add your own extra polyfills to this file. - * - * This file is divided into 2 sections: - * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. - * 2. Application imports. Files imported after ZoneJS that should be loaded before your main - * file. - * - * The current setup is for so-called "evergreen" browsers; the last versions of browsers that - * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), - * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. - * - * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html - */ - -/*************************************************************************************************** - * BROWSER POLYFILLS - */ - -/** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/set'; - -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. - -/** IE10 and IE11 requires the following to support `@angular/animation`. */ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. - - -/** Evergreen browsers require these. **/ -import 'core-js/es6/reflect'; -import 'core-js/es7/reflect'; - - -/** ALL Firefox browsers require the following to support `@angular/animation`. **/ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. - - - -/*************************************************************************************************** - * Zone JS is required by Angular itself. - */ -import 'zone.js/dist/zone'; // Included with Angular CLI. - - - -/*************************************************************************************************** - * APPLICATION IMPORTS - */ - -/** - * Date, currency, decimal and percent pipes. - * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 - */ -// import 'intl'; // Run `npm install --save intl`. diff --git a/lib/test/test.ts b/lib/test/test.ts deleted file mode 100644 index e278843dbe..0000000000 --- a/lib/test/test.ts +++ /dev/null @@ -1,34 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/dist/long-stack-trace-zone'; -import 'zone.js/dist/proxy.js'; -import 'zone.js/dist/sync-test'; -import 'zone.js/dist/jasmine-patch'; -import 'zone.js/dist/async-test'; -import 'zone.js/dist/fake-async-test'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. -declare var __karma__: any; -declare var require: any; - -// Prevent Karma from running prematurely. -__karma__.loaded = function () {}; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); -// Then we find all the tests. -const context = require.context('../src/', true, /\.spec\.ts$/); - -// And load the modules. -context.keys().map(context); - -// Finally, start Karma to run the tests. -__karma__.start(); diff --git a/package.json b/package.json index a35deab045..a61527e7ab 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,33 @@ { - "name": "igo-lib", - "version": "0.0.1", - "description": "Infrastructure géomatique ouverte", + "name": "igo2", + "version": "0.0.5", + "description": "IGO Library", + "main": "bundle/igo.js", + "typings": "dist/index.d.ts", "repository": { + "type": "git", "url": "https://github.com/infra-geo-ouverte/igo2-lib.git" }, - "license": "LiLiQ-R", + "keywords": [ + "igo" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/infra-geo-ouverte/igo2-lib/issues" + }, + "homepage": "https://github.com/infra-geo-ouverte/igo2-lib#readme", "scripts": { "ng": "ng", "start": "ng serve --app demo --proxy-config proxy.conf.json", - "build.lib": "gulp && ngc -p ./lib/tsconfig.lib.json && npm run build.lib.bundle", + "start.lib": "ng serve --proxy-config proxy.conf.json", + "build.lib": "npm run clean && gulp && ngc -p ./src/lib/tsconfig.lib.json && npm run build.lib.bundle", "build.lib.bundle": "webpack --config webpack.conf.js --bail", "build.demo": "ng build --app demo", - "test.lib": "ng test --single-run ", - "test.demo": "ng test -c karma.demo.conf.js --single-run", - "test": "npm run lint && npm run test.lib && npm run test.demo", + "test": "npm run lint && ng test --single-run", "lint": "ng lint", - "e2e": "ng e2e --app demo" + "e2e": "ng e2e --app demo", + "clean": "rimraf dist && rimraf bundle", + "i18n.extract": "ngx-translate-extract -i ./src/lib -o ./src/assets/locale/fr.json ./src/assets/locale/en.json -s -f namespaced-json -m _ -c" }, "dependencies": { "@angular/animations": "^4.0.0", diff --git a/demo-app/assets/fonts/MaterialIcons-Regular.eot b/src/assets/fonts/MaterialIcons-Regular.eot similarity index 100% rename from demo-app/assets/fonts/MaterialIcons-Regular.eot rename to src/assets/fonts/MaterialIcons-Regular.eot diff --git a/demo-app/assets/fonts/MaterialIcons-Regular.ttf b/src/assets/fonts/MaterialIcons-Regular.ttf similarity index 100% rename from demo-app/assets/fonts/MaterialIcons-Regular.ttf rename to src/assets/fonts/MaterialIcons-Regular.ttf diff --git a/demo-app/assets/fonts/MaterialIcons-Regular.woff b/src/assets/fonts/MaterialIcons-Regular.woff similarity index 100% rename from demo-app/assets/fonts/MaterialIcons-Regular.woff rename to src/assets/fonts/MaterialIcons-Regular.woff diff --git a/demo-app/assets/fonts/MaterialIcons-Regular.woff2 b/src/assets/fonts/MaterialIcons-Regular.woff2 similarity index 100% rename from demo-app/assets/fonts/MaterialIcons-Regular.woff2 rename to src/assets/fonts/MaterialIcons-Regular.woff2 diff --git a/assets/icons/place_blue_36px.svg b/src/assets/icons/place_blue_36px.svg similarity index 100% rename from assets/icons/place_blue_36px.svg rename to src/assets/icons/place_blue_36px.svg diff --git a/src/assets/locale/en.json b/src/assets/locale/en.json new file mode 100644 index 0000000000..1df4ec4208 --- /dev/null +++ b/src/assets/locale/en.json @@ -0,0 +1,13 @@ +{ + "igo": { + "endDate": "End Date", + "hideLayer": "Hide Layer", + "lowerLayer": "Bring layer backward", + "noLegendText": "No legend available for this layer", + "opacity": "Opacity", + "raiseLayer": "Bring layer forward", + "removeLayer": "Remove this layer from the map", + "showLayer": "Show Layer", + "startDate": "Start Date" + } +} diff --git a/src/assets/locale/fr.json b/src/assets/locale/fr.json new file mode 100644 index 0000000000..856dec7d6c --- /dev/null +++ b/src/assets/locale/fr.json @@ -0,0 +1,13 @@ +{ + "igo": { + "endDate": "Date de fin", + "hideLayer": "Masquer la couche", + "lowerLayer": "Descendre la couche", + "noLegendText": "Aucune légende disponible pour cette couche", + "opacity": "Opacité", + "raiseLayer": "Monter la couche", + "removeLayer": "Retirer la couche de la carte", + "showLayer": "Afficher la couche", + "startDate": "Date de début" + } +} diff --git a/demo-app/app/app.component.html b/src/demo-app/app/app.component.html similarity index 96% rename from demo-app/app/app.component.html rename to src/demo-app/app/app.component.html index 8df7ac1d9e..7eb60d8d25 100644 --- a/demo-app/app/app.component.html +++ b/src/demo-app/app/app.component.html @@ -3,7 +3,7 @@ search-bar.component diff --git a/demo-app/app/app.component.spec.ts b/src/demo-app/app/app.component.spec.ts similarity index 99% rename from demo-app/app/app.component.spec.ts rename to src/demo-app/app/app.component.spec.ts index 9837f6910f..9b21889555 100644 --- a/demo-app/app/app.component.spec.ts +++ b/src/demo-app/app/app.component.spec.ts @@ -1,6 +1,6 @@ import { TestBed, async } from '@angular/core/testing'; import { MaterialModule } from '@angular/material'; -import { IgoModule, provideDefaultSearchSources } from '../../lib/src'; +import { IgoModule, provideDefaultSearchSources } from '../../lib'; import { AppComponent } from './app.component'; diff --git a/demo-app/app/app.component.styl b/src/demo-app/app/app.component.styl similarity index 100% rename from demo-app/app/app.component.styl rename to src/demo-app/app/app.component.styl diff --git a/demo-app/app/app.component.ts b/src/demo-app/app/app.component.ts similarity index 93% rename from demo-app/app/app.component.ts rename to src/demo-app/app/app.component.ts index 367785adab..13114d9585 100644 --- a/demo-app/app/app.component.ts +++ b/src/demo-app/app/app.component.ts @@ -4,7 +4,7 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { IgoMap, LayerService, Tool, OverlayService, QueryFormat, Feature, FeatureService, - WMSLayerOptions, LanguageService } from '../../lib/src'; + WMSLayerOptions, LanguageService } from '../../lib'; @Component({ selector: 'igo-demo', @@ -31,9 +31,9 @@ export class AppComponent implements OnInit { constructor(public featureService: FeatureService, public layerService: LayerService, public overlayService: OverlayService, - private language: LanguageService) { + public language: LanguageService) { - this.language.readTranslation('/assets/locale/'); + // this.language.readTranslation('/assets/locale/'); } ngOnInit() { diff --git a/demo-app/app/app.module.ts b/src/demo-app/app/app.module.ts similarity index 98% rename from demo-app/app/app.module.ts rename to src/demo-app/app/app.module.ts index 443a9b10dc..fd27e79bd0 100644 --- a/demo-app/app/app.module.ts +++ b/src/demo-app/app/app.module.ts @@ -4,7 +4,7 @@ import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; import { MaterialModule } from '@angular/material'; -import { IgoModule, provideDefaultSearchSources } from '../../lib/src'; +import { IgoModule, provideDefaultSearchSources } from '../../lib'; import { AppComponent } from './app.component'; @NgModule({ diff --git a/src/demo-app/assets/locale/en.json b/src/demo-app/assets/locale/en.json new file mode 100644 index 0000000000..ddc9ba64bd --- /dev/null +++ b/src/demo-app/assets/locale/en.json @@ -0,0 +1,3 @@ +{ + "Search for an address or a place": "Search for an address or a place" +} diff --git a/src/demo-app/assets/locale/fr.json b/src/demo-app/assets/locale/fr.json new file mode 100644 index 0000000000..bce85d43cc --- /dev/null +++ b/src/demo-app/assets/locale/fr.json @@ -0,0 +1,3 @@ +{ + "Search for an address or a place": "Rechercher une adresse, un lieu ou une couche" +} diff --git a/demo-app/css/styles.styl b/src/demo-app/css/styles.styl similarity index 69% rename from demo-app/css/styles.styl rename to src/demo-app/css/styles.styl index caf5355cbc..d3465e4666 100644 --- a/demo-app/css/styles.styl +++ b/src/demo-app/css/styles.styl @@ -1,17 +1,17 @@ @import '~@angular/material/prebuilt-themes/deeppurple-amber.css'; -@import '../../lib/themes/deeppurple-amber.styl'; -@import '../../lib/styles.styl'; +@import '../../themes/deeppurple-amber.styl'; +@import '../../styles.styl'; @font-face { font-family: 'Material Icons'; font-style: normal; font-weight: 400; - src: url(../assets/fonts/MaterialIcons-Regular.eot); /* For IE6-8 */ + src: url(../../assets/fonts/MaterialIcons-Regular.eot); /* For IE6-8 */ src: local('Material Icons'), local('MaterialIcons-Regular'), - url(../assets/fonts/MaterialIcons-Regular.woff2) format('woff2'), - url(../assets/fonts/MaterialIcons-Regular.woff) format('woff'), - url(../assets/fonts/MaterialIcons-Regular.ttf) format('truetype'); + url(../../assets/fonts/MaterialIcons-Regular.woff2) format('woff2'), + url(../../assets/fonts/MaterialIcons-Regular.woff) format('woff'), + url(../../assets/fonts/MaterialIcons-Regular.ttf) format('truetype'); } .material-icons { diff --git a/demo-app/environments/environment.prod.ts b/src/demo-app/environments/environment.prod.ts similarity index 100% rename from demo-app/environments/environment.prod.ts rename to src/demo-app/environments/environment.prod.ts diff --git a/demo-app/environments/environment.ts b/src/demo-app/environments/environment.ts similarity index 100% rename from demo-app/environments/environment.ts rename to src/demo-app/environments/environment.ts diff --git a/demo-app/favicon.ico b/src/demo-app/favicon.ico similarity index 100% rename from demo-app/favicon.ico rename to src/demo-app/favicon.ico diff --git a/demo-app/index.html b/src/demo-app/index.html similarity index 100% rename from demo-app/index.html rename to src/demo-app/index.html diff --git a/demo-app/main.ts b/src/demo-app/main.ts similarity index 100% rename from demo-app/main.ts rename to src/demo-app/main.ts diff --git a/demo-app/polyfills.ts b/src/demo-app/polyfills.ts similarity index 100% rename from demo-app/polyfills.ts rename to src/demo-app/polyfills.ts diff --git a/demo-app/tsconfig.app.json b/src/demo-app/tsconfig.demo.json similarity index 66% rename from demo-app/tsconfig.app.json rename to src/demo-app/tsconfig.demo.json index 5e2507db58..0371bec04b 100644 --- a/demo-app/tsconfig.app.json +++ b/src/demo-app/tsconfig.demo.json @@ -1,7 +1,7 @@ { - "extends": "../tsconfig.json", + "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "../out-tsc/app", + "outDir": "../../out-tsc/app", "module": "es2015", "baseUrl": "", "types": [] diff --git a/demo-app/typings.d.ts b/src/demo-app/typings.d.ts similarity index 100% rename from demo-app/typings.d.ts rename to src/demo-app/typings.d.ts diff --git a/lib/src/core.ts b/src/lib/core.ts similarity index 100% rename from lib/src/core.ts rename to src/lib/core.ts diff --git a/lib/src/core/index.ts b/src/lib/core/index.ts similarity index 100% rename from lib/src/core/index.ts rename to src/lib/core/index.ts diff --git a/lib/src/core/message/index.ts b/src/lib/core/message/index.ts similarity index 100% rename from lib/src/core/message/index.ts rename to src/lib/core/message/index.ts diff --git a/lib/src/core/message/message.interface.ts b/src/lib/core/message/message.interface.ts similarity index 100% rename from lib/src/core/message/message.interface.ts rename to src/lib/core/message/message.interface.ts diff --git a/lib/src/core/message/message.service.spec.ts b/src/lib/core/message/message.service.spec.ts similarity index 100% rename from lib/src/core/message/message.service.spec.ts rename to src/lib/core/message/message.service.spec.ts diff --git a/lib/src/core/message/message.service.ts b/src/lib/core/message/message.service.ts similarity index 100% rename from lib/src/core/message/message.service.ts rename to src/lib/core/message/message.service.ts diff --git a/lib/src/core/module.ts b/src/lib/core/module.ts similarity index 100% rename from lib/src/core/module.ts rename to src/lib/core/module.ts diff --git a/lib/src/core/request/index.ts b/src/lib/core/request/index.ts similarity index 100% rename from lib/src/core/request/index.ts rename to src/lib/core/request/index.ts diff --git a/lib/src/core/request/request.service.spec.ts b/src/lib/core/request/request.service.spec.ts similarity index 100% rename from lib/src/core/request/request.service.spec.ts rename to src/lib/core/request/request.service.spec.ts diff --git a/lib/src/core/request/request.service.ts b/src/lib/core/request/request.service.ts similarity index 100% rename from lib/src/core/request/request.service.ts rename to src/lib/core/request/request.service.ts diff --git a/lib/src/feature/feature-details/feature-details.component.html b/src/lib/feature/feature-details/feature-details.component.html similarity index 100% rename from lib/src/feature/feature-details/feature-details.component.html rename to src/lib/feature/feature-details/feature-details.component.html diff --git a/lib/src/feature/feature-details/feature-details.component.spec.ts b/src/lib/feature/feature-details/feature-details.component.spec.ts similarity index 100% rename from lib/src/feature/feature-details/feature-details.component.spec.ts rename to src/lib/feature/feature-details/feature-details.component.spec.ts diff --git a/lib/src/feature/feature-details/feature-details.component.styl b/src/lib/feature/feature-details/feature-details.component.styl similarity index 100% rename from lib/src/feature/feature-details/feature-details.component.styl rename to src/lib/feature/feature-details/feature-details.component.styl diff --git a/lib/src/feature/feature-details/feature-details.component.ts b/src/lib/feature/feature-details/feature-details.component.ts similarity index 100% rename from lib/src/feature/feature-details/feature-details.component.ts rename to src/lib/feature/feature-details/feature-details.component.ts diff --git a/lib/src/feature/feature-details/index.ts b/src/lib/feature/feature-details/index.ts similarity index 100% rename from lib/src/feature/feature-details/index.ts rename to src/lib/feature/feature-details/index.ts diff --git a/lib/src/feature/feature-item/feature-item.component.html b/src/lib/feature/feature-item/feature-item.component.html similarity index 100% rename from lib/src/feature/feature-item/feature-item.component.html rename to src/lib/feature/feature-item/feature-item.component.html diff --git a/lib/src/feature/feature-item/feature-item.component.spec.ts b/src/lib/feature/feature-item/feature-item.component.spec.ts similarity index 100% rename from lib/src/feature/feature-item/feature-item.component.spec.ts rename to src/lib/feature/feature-item/feature-item.component.spec.ts diff --git a/lib/src/feature/feature-item/feature-item.component.styl b/src/lib/feature/feature-item/feature-item.component.styl similarity index 100% rename from lib/src/feature/feature-item/feature-item.component.styl rename to src/lib/feature/feature-item/feature-item.component.styl diff --git a/lib/src/feature/feature-item/feature-item.component.ts b/src/lib/feature/feature-item/feature-item.component.ts similarity index 100% rename from lib/src/feature/feature-item/feature-item.component.ts rename to src/lib/feature/feature-item/feature-item.component.ts diff --git a/lib/src/feature/feature-item/index.ts b/src/lib/feature/feature-item/index.ts similarity index 100% rename from lib/src/feature/feature-item/index.ts rename to src/lib/feature/feature-item/index.ts diff --git a/lib/src/feature/feature-list/feature-list-base.component.html b/src/lib/feature/feature-list/feature-list-base.component.html similarity index 100% rename from lib/src/feature/feature-list/feature-list-base.component.html rename to src/lib/feature/feature-list/feature-list-base.component.html diff --git a/lib/src/feature/feature-list/feature-list-base.component.spec.ts b/src/lib/feature/feature-list/feature-list-base.component.spec.ts similarity index 100% rename from lib/src/feature/feature-list/feature-list-base.component.spec.ts rename to src/lib/feature/feature-list/feature-list-base.component.spec.ts diff --git a/lib/src/feature/feature-list/feature-list-base.component.styl b/src/lib/feature/feature-list/feature-list-base.component.styl similarity index 100% rename from lib/src/feature/feature-list/feature-list-base.component.styl rename to src/lib/feature/feature-list/feature-list-base.component.styl diff --git a/lib/src/feature/feature-list/feature-list-base.component.ts b/src/lib/feature/feature-list/feature-list-base.component.ts similarity index 100% rename from lib/src/feature/feature-list/feature-list-base.component.ts rename to src/lib/feature/feature-list/feature-list-base.component.ts diff --git a/lib/src/feature/feature-list/feature-list.component.html b/src/lib/feature/feature-list/feature-list.component.html similarity index 100% rename from lib/src/feature/feature-list/feature-list.component.html rename to src/lib/feature/feature-list/feature-list.component.html diff --git a/lib/src/feature/feature-list/feature-list.component.spec.ts b/src/lib/feature/feature-list/feature-list.component.spec.ts similarity index 100% rename from lib/src/feature/feature-list/feature-list.component.spec.ts rename to src/lib/feature/feature-list/feature-list.component.spec.ts diff --git a/lib/src/feature/feature-list/feature-list.component.styl b/src/lib/feature/feature-list/feature-list.component.styl similarity index 100% rename from lib/src/feature/feature-list/feature-list.component.styl rename to src/lib/feature/feature-list/feature-list.component.styl diff --git a/lib/src/feature/feature-list/feature-list.component.ts b/src/lib/feature/feature-list/feature-list.component.ts similarity index 100% rename from lib/src/feature/feature-list/feature-list.component.ts rename to src/lib/feature/feature-list/feature-list.component.ts diff --git a/lib/src/feature/feature-list/index.ts b/src/lib/feature/feature-list/index.ts similarity index 100% rename from lib/src/feature/feature-list/index.ts rename to src/lib/feature/feature-list/index.ts diff --git a/lib/src/feature/index.ts b/src/lib/feature/index.ts similarity index 100% rename from lib/src/feature/index.ts rename to src/lib/feature/index.ts diff --git a/lib/src/feature/module.ts b/src/lib/feature/module.ts similarity index 100% rename from lib/src/feature/module.ts rename to src/lib/feature/module.ts diff --git a/lib/src/feature/shared/feature-group.pipe.spec.ts b/src/lib/feature/shared/feature-group.pipe.spec.ts similarity index 100% rename from lib/src/feature/shared/feature-group.pipe.spec.ts rename to src/lib/feature/shared/feature-group.pipe.spec.ts diff --git a/lib/src/feature/shared/feature-group.pipe.ts b/src/lib/feature/shared/feature-group.pipe.ts similarity index 100% rename from lib/src/feature/shared/feature-group.pipe.ts rename to src/lib/feature/shared/feature-group.pipe.ts diff --git a/lib/src/feature/shared/feature.enum.ts b/src/lib/feature/shared/feature.enum.ts similarity index 100% rename from lib/src/feature/shared/feature.enum.ts rename to src/lib/feature/shared/feature.enum.ts diff --git a/lib/src/feature/shared/feature.interface.ts b/src/lib/feature/shared/feature.interface.ts similarity index 100% rename from lib/src/feature/shared/feature.interface.ts rename to src/lib/feature/shared/feature.interface.ts diff --git a/lib/src/feature/shared/feature.service.spec.ts b/src/lib/feature/shared/feature.service.spec.ts similarity index 100% rename from lib/src/feature/shared/feature.service.spec.ts rename to src/lib/feature/shared/feature.service.spec.ts diff --git a/lib/src/feature/shared/feature.service.ts b/src/lib/feature/shared/feature.service.ts similarity index 100% rename from lib/src/feature/shared/feature.service.ts rename to src/lib/feature/shared/feature.service.ts diff --git a/lib/src/feature/shared/index.ts b/src/lib/feature/shared/index.ts similarity index 100% rename from lib/src/feature/shared/index.ts rename to src/lib/feature/shared/index.ts diff --git a/lib/src/filter/filterable-layer/filterable-layer.pipe.spec.ts b/src/lib/filter/filterable-layer/filterable-layer.pipe.spec.ts similarity index 100% rename from lib/src/filter/filterable-layer/filterable-layer.pipe.spec.ts rename to src/lib/filter/filterable-layer/filterable-layer.pipe.spec.ts diff --git a/lib/src/filter/filterable-layer/filterable-layer.pipe.ts b/src/lib/filter/filterable-layer/filterable-layer.pipe.ts similarity index 100% rename from lib/src/filter/filterable-layer/filterable-layer.pipe.ts rename to src/lib/filter/filterable-layer/filterable-layer.pipe.ts diff --git a/lib/src/filter/filterable-layer/index.ts b/src/lib/filter/filterable-layer/index.ts similarity index 100% rename from lib/src/filter/filterable-layer/index.ts rename to src/lib/filter/filterable-layer/index.ts diff --git a/lib/src/filter/index.ts b/src/lib/filter/index.ts similarity index 100% rename from lib/src/filter/index.ts rename to src/lib/filter/index.ts diff --git a/lib/src/filter/module.ts b/src/lib/filter/module.ts similarity index 100% rename from lib/src/filter/module.ts rename to src/lib/filter/module.ts diff --git a/lib/src/filter/shared/index.ts b/src/lib/filter/shared/index.ts similarity index 100% rename from lib/src/filter/shared/index.ts rename to src/lib/filter/shared/index.ts diff --git a/lib/src/filter/shared/time-filter.interface.ts b/src/lib/filter/shared/time-filter.interface.ts similarity index 100% rename from lib/src/filter/shared/time-filter.interface.ts rename to src/lib/filter/shared/time-filter.interface.ts diff --git a/lib/src/filter/time-filter-form/index.ts b/src/lib/filter/time-filter-form/index.ts similarity index 100% rename from lib/src/filter/time-filter-form/index.ts rename to src/lib/filter/time-filter-form/index.ts diff --git a/lib/src/filter/time-filter-form/time-filter-form.component.html b/src/lib/filter/time-filter-form/time-filter-form.component.html similarity index 84% rename from lib/src/filter/time-filter-form/time-filter-form.component.html rename to src/lib/filter/time-filter-form/time-filter-form.component.html index 28dac831cf..953c2a4d45 100644 --- a/lib/src/filter/time-filter-form/time-filter-form.component.html +++ b/src/lib/filter/time-filter-form/time-filter-form.component.html @@ -1,7 +1,7 @@
-
\ No newline at end of file +
diff --git a/lib/src/filter/time-filter-form/time-filter-form.component.spec.ts b/src/lib/filter/time-filter-form/time-filter-form.component.spec.ts similarity index 100% rename from lib/src/filter/time-filter-form/time-filter-form.component.spec.ts rename to src/lib/filter/time-filter-form/time-filter-form.component.spec.ts diff --git a/lib/src/filter/time-filter-form/time-filter-form.component.styl b/src/lib/filter/time-filter-form/time-filter-form.component.styl similarity index 100% rename from lib/src/filter/time-filter-form/time-filter-form.component.styl rename to src/lib/filter/time-filter-form/time-filter-form.component.styl diff --git a/lib/src/filter/time-filter-form/time-filter-form.component.ts b/src/lib/filter/time-filter-form/time-filter-form.component.ts similarity index 100% rename from lib/src/filter/time-filter-form/time-filter-form.component.ts rename to src/lib/filter/time-filter-form/time-filter-form.component.ts diff --git a/lib/src/filter/time-filter-item/index.ts b/src/lib/filter/time-filter-item/index.ts similarity index 100% rename from lib/src/filter/time-filter-item/index.ts rename to src/lib/filter/time-filter-item/index.ts diff --git a/lib/src/filter/time-filter-item/time-filter-item.component.html b/src/lib/filter/time-filter-item/time-filter-item.component.html similarity index 100% rename from lib/src/filter/time-filter-item/time-filter-item.component.html rename to src/lib/filter/time-filter-item/time-filter-item.component.html diff --git a/lib/src/filter/time-filter-item/time-filter-item.component.spec.ts b/src/lib/filter/time-filter-item/time-filter-item.component.spec.ts similarity index 100% rename from lib/src/filter/time-filter-item/time-filter-item.component.spec.ts rename to src/lib/filter/time-filter-item/time-filter-item.component.spec.ts diff --git a/lib/src/filter/time-filter-item/time-filter-item.component.styl b/src/lib/filter/time-filter-item/time-filter-item.component.styl similarity index 100% rename from lib/src/filter/time-filter-item/time-filter-item.component.styl rename to src/lib/filter/time-filter-item/time-filter-item.component.styl diff --git a/lib/src/filter/time-filter-item/time-filter-item.component.ts b/src/lib/filter/time-filter-item/time-filter-item.component.ts similarity index 100% rename from lib/src/filter/time-filter-item/time-filter-item.component.ts rename to src/lib/filter/time-filter-item/time-filter-item.component.ts diff --git a/lib/src/filter/time-filter-list/index.ts b/src/lib/filter/time-filter-list/index.ts similarity index 100% rename from lib/src/filter/time-filter-list/index.ts rename to src/lib/filter/time-filter-list/index.ts diff --git a/lib/src/filter/time-filter-list/time-filter-list.component.html b/src/lib/filter/time-filter-list/time-filter-list.component.html similarity index 100% rename from lib/src/filter/time-filter-list/time-filter-list.component.html rename to src/lib/filter/time-filter-list/time-filter-list.component.html diff --git a/lib/src/filter/time-filter-list/time-filter-list.component.spec.ts b/src/lib/filter/time-filter-list/time-filter-list.component.spec.ts similarity index 100% rename from lib/src/filter/time-filter-list/time-filter-list.component.spec.ts rename to src/lib/filter/time-filter-list/time-filter-list.component.spec.ts diff --git a/lib/src/filter/time-filter-list/time-filter-list.component.styl b/src/lib/filter/time-filter-list/time-filter-list.component.styl similarity index 100% rename from lib/src/filter/time-filter-list/time-filter-list.component.styl rename to src/lib/filter/time-filter-list/time-filter-list.component.styl diff --git a/lib/src/filter/time-filter-list/time-filter-list.component.ts b/src/lib/filter/time-filter-list/time-filter-list.component.ts similarity index 100% rename from lib/src/filter/time-filter-list/time-filter-list.component.ts rename to src/lib/filter/time-filter-list/time-filter-list.component.ts diff --git a/lib/src/index.ts b/src/lib/index.ts similarity index 100% rename from lib/src/index.ts rename to src/lib/index.ts diff --git a/lib/src/language/index.ts b/src/lib/language/index.ts similarity index 100% rename from lib/src/language/index.ts rename to src/lib/language/index.ts diff --git a/lib/src/language/module.ts b/src/lib/language/module.ts similarity index 100% rename from lib/src/language/module.ts rename to src/lib/language/module.ts diff --git a/lib/src/language/shared/index.ts b/src/lib/language/shared/index.ts similarity index 100% rename from lib/src/language/shared/index.ts rename to src/lib/language/shared/index.ts diff --git a/lib/src/language/shared/language.service.spec.ts b/src/lib/language/shared/language.service.spec.ts similarity index 100% rename from lib/src/language/shared/language.service.spec.ts rename to src/lib/language/shared/language.service.spec.ts diff --git a/lib/src/language/shared/language.service.ts b/src/lib/language/shared/language.service.ts similarity index 100% rename from lib/src/language/shared/language.service.ts rename to src/lib/language/shared/language.service.ts diff --git a/lib/src/language/shared/missing-translation.guard.ts b/src/lib/language/shared/missing-translation.guard.ts similarity index 100% rename from lib/src/language/shared/missing-translation.guard.ts rename to src/lib/language/shared/missing-translation.guard.ts diff --git a/lib/src/layer/index.ts b/src/lib/layer/index.ts similarity index 100% rename from lib/src/layer/index.ts rename to src/lib/layer/index.ts diff --git a/lib/src/layer/layer-item/index.ts b/src/lib/layer/layer-item/index.ts similarity index 100% rename from lib/src/layer/layer-item/index.ts rename to src/lib/layer/layer-item/index.ts diff --git a/lib/src/layer/layer-item/layer-item.component.html b/src/lib/layer/layer-item/layer-item.component.html similarity index 84% rename from lib/src/layer/layer-item/layer-item.component.html rename to src/lib/layer/layer-item/layer-item.component.html index b37d94e27e..b9b5b9f800 100644 --- a/lib/src/layer/layer-item/layer-item.component.html +++ b/src/lib/layer/layer-item/layer-item.component.html @@ -13,7 +13,9 @@

{{layer.title}}

md-icon-button collapsibleButton tooltip-position="below" - [md-tooltip]="(layer.visible ? 'Hide Layer' : 'Show Layer') | translate" + [md-tooltip]="layer.visible ? + ('igo.hideLayer' | translate) : + ('igo.showLayer' | translate)" [color]="color" (click)="toggleVisibility()"> @@ -38,7 +40,7 @@

{{layer.title}}

- {{layer.title}} [min]="0" [max]="100" [(ngModel)]="opacity" - [md-tooltip]="'Opacity' | translate" + [md-tooltip]="'igo.opacity' | translate" tooltip-position="below">
@@ -56,7 +58,7 @@

{{layer.title}}