def test_webpack_theme_bundle_outside_app():
    """Access a bundle property outside app context."""
    # Test that bundles are created for each theme.
    bundle = WebpackThemeBundle(
        'tests',
        'assets',
        default='semantic-ui',
        themes={
            'semantic-ui': dict(
                entry={
                    'theme': './theme-semantic-ui.css',
                }
            ),
        }
    )
    pytest.raises(AttributeError, getattr, bundle, 'path')
def test_webpack_theme_bundle(app):
    """Test WebpackThemeBundle."""
    themes = {
        'bootstrap3': dict(
            entry={
                'theme': './theme-bootstrap3.css',
            }
        ),
        'semantic-ui': dict(
            entry={
                'theme': './theme-semantic-ui.css',
            }
        ),
    }

    # Test that bundles are created for each theme.
    bundle = WebpackThemeBundle(
        'tests', 'assets', default='semantic-ui', themes=themes)
    assert isinstance(bundle.themes['bootstrap3'], WebpackBundle)
    assert isinstance(bundle.themes['semantic-ui'], WebpackBundle)

    # Test that default theme is used.
    with app.app_context():
        assert bundle._active_theme_bundle == bundle.themes['semantic-ui']
        assert bundle.path == bundle.themes['semantic-ui'].path
        assert bundle.entry == bundle.themes['semantic-ui'].entry
        assert bundle.dependencies == bundle.themes['semantic-ui'].dependencies

    # Test that APP_THEME overrides default theme.
    app.config['APP_THEME'] = ['bootstrap3']
    with app.app_context():
        assert bundle._active_theme_bundle == bundle.themes['bootstrap3']
        assert bundle.path == bundle.themes['bootstrap3'].path
        assert bundle.entry == bundle.themes['bootstrap3'].entry
        assert bundle.dependencies == bundle.themes['bootstrap3'].dependencies

    # Test that an invalid APP_THEME
    app.config['APP_THEME'] = ['invalid']
    with app.app_context():
        assert bundle._active_theme_bundle is None
Exemple #3
0
def theme():
    """Returns module's webpack bundle.

    This is a callable function in order to lazy load `current_app`
    and avoid working outside application context.
    """
    return WebpackThemeBundle(
        __name__,
        'assets',
        default='semantic-ui',
        themes={
            'semantic-ui':
            dict(
                entry={
                    'invenio-app-rdm-theme':
                    current_app.config['INSTANCE_THEME_FILE'],
                    'invenio-app-rdm-search-theme':
                    current_app.config['INSTANCE_SEARCH_THEME_FILE'],
                    'invenio-app-rdm-deposits-deposit-searchbar-js':
                    './js/invenio_app_rdm/deposits/RDMDepositSearchBar/index.js',  # noqa
                    'invenio-app-rdm-deposits-deposit-form-js':
                    './js/invenio_app_rdm/deposits/RDMDepositForm/index.js',  # noqa
                    'invenio-app-rdm-search-app-js':
                    './js/invenio_app_rdm/search_app_customizations.js',
                },
                dependencies={
                    # add any additional npm dependencies here...
                    "@babel/runtime": "^7.9.0",
                    'formik': '^2.1.4',
                    'luxon': '^1.23.0',
                    'path': '^0.12.7',
                    'prop-types': '^15.7.2',
                    'react-invenio-deposit': '^0.2.0',
                    'react-invenio-forms': '^0.3.0',
                },
                aliases={
                    '../../theme.config$': 'less/theme.config',
                    '@templates': "templates",
                }),
        })
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021-2022 GEO Secretariat.
#
# geo-knowledge-hub is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""GEO Knowledge Hub Deposit (page) webpack."""

from invenio_assets.webpack import WebpackThemeBundle

theme = WebpackThemeBundle(
    import_name=__name__,
    folder="theme/assets",
    default="semantic-ui",
    themes={
        "semantic-ui":
        dict(
            entry={
                "geo-knowledge-hub-deposit":
                "./js/geo_knowledge_hub_deposit/deposit_form/index.js",
            },
            dependencies={
                "sweetalert2": "^11.1.7",
                "sweetalert2-react-content": "^4.1.1",
            },
            aliases={"@invenio-app-rdm": "js/invenio_app_rdm"},
        )
    },
)
Exemple #5
0
"""JS/CSS webpack bundles for theme."""

from invenio_assets.webpack import WebpackThemeBundle


theme = WebpackThemeBundle(
    __name__,
    'assets',
    default='semantic-ui',
    themes={
        'semantic-ui': dict(
            entry={
                'cernopendata_css': './scss/styles.scss',
                'cernopendata_js': './js/app.js'
            },
            dependencies={
                'open-iconic': '~1.1.1',
                'popper.js': '~1.11.0',
            },
            aliases={
                '../../theme.config$': 'less/cernopendata/theme.config',
            },
        ),
    }
)


glossary = WebpackThemeBundle(
    __name__,
    'assets',
    default='semantic-ui',
Exemple #6
0
search_ui = WebpackThemeBundle(
    __name__,
    "assets",
    default="semantic-ui",
    themes={
        "semantic-ui":
        dict(entry={
            "invenio_search_ui_app": "./js/invenio_search_ui/app.js",
        },
             dependencies={
                 "axios": "^0.19.0",
                 "lodash": "^4.17.15",
                 "qs": "^6.8.0",
                 "react": "^16.13.0",
                 "react-dom": "^16.13.0",
                 "react-overridable": "^0.0.2",
                 "react-redux": "^7.2",
                 "redux": "^4.0.5",
                 "redux-thunk": "^2.3.0",
                 "react-searchkit": "^1.0.0-alpha.6",
                 "semantic-ui-css": "^2.4.1",
                 "semantic-ui-react": "^0.88.0",
                 "@babel/runtime": "^7.9.0",
             },
             aliases={
                 '@js/invenio_search_ui': 'js/invenio_search_ui',
             }),
        "bootstrap3":
        dict(
            entry={
                "search_ui_app": "./js/invenio_search_ui/app.js",
                "search_ui_theme": "./scss/invenio_search_ui/search.scss",
            },
            dependencies={
                "almond": "~0.3.1",
                "angular": "~1.4.10",
                "angular-loading-bar": "~0.9.0",
                "d3": "^3.5.17",
                "invenio-search-js": "^1.3.1",
                "jquery": "~3.2.1",
            },
        ),
    },
)
Exemple #7
0
#  under the terms of the MIT License; see LICENSE file for more details.
#

#
#
# iroko is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.
"""JS/CSS Webpack bundle to override search results template."""

from invenio_assets.webpack import WebpackThemeBundle

search_app = WebpackThemeBundle(__name__,
                                'assets',
                                default='semantic-ui',
                                themes={
                                    'bootstrap3':
                                    dict(entry={}, dependencies={},
                                         aliases={}),
                                    'semantic-ui':
                                    dict(entry={
                                        'iroko-search-app':
                                        './js/iroko_records/index.js',
                                    },
                                         dependencies={
                                             "react": "^16.9.0",
                                             "react-dom": "^16.9.0",
                                             "react-overridable": "^0.0.2",
                                             "semantic-ui-react": "^0.88.0"
                                         })
                                })
Exemple #8
0
theme = WebpackThemeBundle(
    __name__,
    'assets',
    default='semantic-ui',
    themes={
        'semantic-ui':
        dict(
            entry={
                'invenio-app-rdm-landing-page':
                './js/invenio_app_rdm/landing_page/index.js',
                'invenio-app-rdm-deposit':
                './js/invenio_app_rdm/deposit/index.js',
                'invenio-app-rdm-search':
                './js/invenio_app_rdm/search/index.js',
                'invenio-app-rdm-user-records-search':
                './js/invenio_app_rdm/user_records_search/index.js',
            },
            dependencies={
                # add any additional npm dependencies here...
                "@babel/runtime": "^7.9.0",
                'formik': '^2.1.4',
                'luxon': '^1.23.0',
                'path': '^0.12.7',
                'prop-types': '^15.7.2',
                'react-dnd': '^11.1.3',
                'react-dnd-html5-backend': '^11.1.3',
                'react-invenio-deposit': '^0.13.5',
                'react-invenio-forms': '^0.7.0',
                'react-dropzone': "^11.0.3",
                'yup': '^0.27.0',
                '@ckeditor/ckeditor5-build-classic': '^16.0.0',
                '@ckeditor/ckeditor5-react': '^2.1.0',
            },
            aliases={
                # Define Semantic-UI theme configuration needed by
                # Invenio-Theme in order to build Semantic UI (in theme.js
                # entry point). theme.config itself is provided by
                # cookiecutter-invenio-rdm.
                '../../theme.config$': 'less/theme.config',
                'themes/rdm': 'less/invenio_app_rdm/theme',
                '@less/invenio_app_rdm': 'less/invenio_app_rdm',
            }),
    })
Exemple #9
0
theme = WebpackThemeBundle(
    __name__,
    'assets',
    default='bootstrap3',
    themes={
        'bootstrap3': dict(
            entry={
                'base': './js/invenio_theme/base.js',
                # requires jquery, moment, select2, bootstrap
                'adminlte': './js/invenio_theme/admin.js',
                'theme-admin': './scss/invenio_theme/admin.scss',
                'theme': './scss/invenio_theme/theme.scss',
            },
            dependencies={
                'bootstrap-sass': '~3.3.5',
                'font-awesome': '~4.4.0',
                'jquery': '~3.2.1',
                'moment': '~2.23.0',
                'select2': '~4.0.2',
                'admin-lte': '~2.4.8',
            }
        ),
        'semantic-ui': dict(
            entry={
                'base': './js/invenio_theme/base.js',
                'theme': './js/invenio_theme/theme.js',
            },
            dependencies={
                'semantic-ui-less': '~2.4.1',
                'semantic-ui-css': '~2.4.1',
                'font-awesome': '~4.4.0',
                'jquery': '~3.2.1',
            },
            aliases={
                '@invenio_theme/less': 'less/invenio_theme',
                'themes/invenio': 'less/invenio_theme/theme'
            }
        ),
    }
)
theme = WebpackThemeBundle(
    __name__,
    'assets',
    default='bootstrap3',
    themes={
        'bootstrap3':
        dict(
            entry={
                'base': './js/invenio_theme/base.js',
                # requires jquery, moment, select2, bootstrap
                'adminlte': './js/invenio_theme/admin.js',
                'theme-admin': './scss/invenio_theme/admin.scss',
                'theme': './scss/invenio_theme/theme.scss',
            },
            dependencies={
                'bootstrap-sass': '~3.3.5',
                'font-awesome': '~4.4.0',
                'jquery': '~3.2.1',
                'moment': '~2.23.0',
                'select2': '~4.0.2',
                'admin-lte': '~2.4.8',
            }),
        'semantic-ui':
        dict(
            entry={
                'base': './js/invenio_theme/base.js',
                # theme.js is the main file for the Semantic-UI theme.
                # - theme.js imports semantic-ui-less/semantic.less
                # - semantic-ui-less/semantic.less imports various files
                #   that all import ""../../theme.config".
                # - theme.config (must be provided by an Invenio instance, that
                #   sets this as an alias) imports semantic-ui-less/theme.less.
                # - semantic-ui-less/theme.less imports
                #   1) the theme package: an invenio theme is configured below
                #      via the "themes/invenio" alias). theme.config set the
                #      respective variables to the "invenio" theme (e.g.
                #      "@site: 'invenio';").
                #   2) site theme: defined via the @siteFolder variable in
                #      "theme.config".
                'theme': './js/invenio_theme/theme.js',
            },
            dependencies={
                'semantic-ui-less': '~2.4.1',
                'semantic-ui-css': '~2.4.1',
                'font-awesome': '~4.4.0',
                'jquery': '~3.2.1',
            },
            aliases={
                '@invenio_theme/less': 'less/invenio_theme',
                # Used for defining an 'invenio' theme for Semantic-UI. The
                # code in "Semantic-UI-Less/theme.less" will look for e.g.
                # themes/@{theme}/globals/site.variables". This will resolve
                # to the path "less/invenio_theme/theme/global/site.variables".
                # This means that you in "theme.config" can use "invenio" as a
                # theme, e.g.:
                #   @site: 'invenio';
                'themes/invenio': 'less/invenio_theme/theme'
            }),
    })
theme = WebpackThemeBundle(
    __name__,
    "assets",
    default="semantic-ui",
    themes={
        "semantic-ui":
        dict(
            entry={
                "invenio-records-marc21-search":
                "./js/invenio_records_marc21/search/index.js",
            },
            dependencies={
                "@babel/runtime": "^7.9.0",
                "formik": "^2.1.4",
                "luxon": "^1.23.0",
                "path": "^0.12.7",
                "prop-types": "^15.7.2",
                "react-dnd": "^11.1.3",
                "react-dnd-html5-backend": "^11.1.3",
                "react-invenio-forms": "^0.6.3",
                "react-dropzone": "^11.0.3",
                "yup": "^0.27.0",
                "@ckeditor/ckeditor5-build-classic": "^16.0.0",
                "@ckeditor/ckeditor5-react": "^2.1.0",
            },
            aliases={
                "themes/marc21": "less/invenio_records_marc21/theme",
                "@less/invenio_records_marc21": "less/invenio_records_marc21",
            },
        ),
    },
)
Exemple #12
0
# under the terms of the MIT License; see LICENSE file for more details.
"""Webpack bundles for Invenio-I18N."""

from invenio_assets.webpack import WebpackThemeBundle

i18n = WebpackThemeBundle(__name__,
                          'assets',
                          default='bootstrap3',
                          themes={
                              'bootstrap3':
                              dict(entry={
                                  'i18n_app': './js/invenio_i18n/app.js',
                              },
                                   dependencies={
                                       'angular': '~1.4.9',
                                       'angular-gettext': '~2.3.8',
                                   }),
                              'semantic-ui':
                              dict(
                                  entry={
                                      'i18n_app': './js/invenio_i18n/app.js',
                                  },
                                  dependencies={
                                      'semantic-ui-less': '~2.4.1',
                                      'semantic-ui-css': '~2.4.1',
                                      'font-awesome': '~4.4.0',
                                      'jquery': '~3.2.1',
                                  },
                              ),
                          })
Exemple #13
0
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
# Copyright (C) 2020 Northwestern University.
#
# Invenio RDM Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""JS/CSS Webpack bundles for theme."""

from invenio_assets.webpack import WebpackThemeBundle

theme = WebpackThemeBundle(
    __name__,
    "assets",
    default="semantic-ui",
    themes={
        "semantic-ui":
        dict(
            entry={
                "invenio-rdm-records-theme":
                "./less/invenio_rdm_records/theme.less",
                "invenio-rdm-records-js":
                "./js/invenio_rdm_records/rdmrecords.js",
            },
            dependencies={},
        )
    },
)
Exemple #14
0
theme = WebpackThemeBundle(
    __name__,
    'assets',
    default='semantic-ui',
    themes={
        'semantic-ui':
        dict(
            entry={
                'invenio-app-rdm-landing-page':
                './js/invenio_app_rdm/landing_page/index.js',
                'invenio-app-rdm-landing-page-theme':
                './js/invenio_app_rdm/landing_page/theme.js',
                'invenio-app-rdm-deposit':
                './js/invenio_app_rdm/deposit/index.js',
                'invenio-app-rdm-search':
                './js/invenio_app_rdm/search/index.js',
                'invenio-app-rdm-user-dashboard':
                './js/invenio_app_rdm/user_dashboard/index.js',
                'base-theme-rdm': './js/invenio_app_rdm/theme.js',
            },
            dependencies={
                '@babel/runtime': '^7.9.0',
                '@ckeditor/ckeditor5-build-classic': '^16.0.0',
                '@ckeditor/ckeditor5-react': '^2.1.0',
                'formik': '^2.1.0',
                "i18next": "^20.3.0",
                "i18next-browser-languagedetector": "^6.1.0",
                'luxon': '^1.23.0',
                'path': '^0.12.7',
                'prop-types': '^15.7.2',
                'react-copy-to-clipboard': '^5.0.0',
                'react-dnd': '^11.1.0',
                'react-dnd-html5-backend': '^11.1.0',
                'react-dropzone': "^11.0.0",
                "react-i18next": "^11.11.0",
                'react-invenio-deposit': '^0.19.0',
                'react-invenio-forms': '^0.10.0',
                'react-searchkit': '^2.0.0',
                'yup': '^0.32.0',
            },
            aliases={
                # Define Semantic-UI theme configuration needed by
                # Invenio-Theme in order to build Semantic UI (in theme.js
                # entry point). theme.config itself is provided by
                # cookiecutter-invenio-rdm.
                '../../theme.config$': 'less/theme.config',
                '../../less/site': 'less/site',
                '../../less': 'less',
                'themes/rdm': 'less/invenio_app_rdm/theme',
                '@less/invenio_app_rdm': 'less/invenio_app_rdm',
                '@translations/invenio_app_rdm':
                'translations/invenio_app_rdm',
            }),
    })
Exemple #15
0
# as an Intergovernmental Organization or submit itself to any jurisdiction.
"""JS/CSS webpack bundles for theme."""

from invenio_assets.webpack import WebpackThemeBundle

theme = WebpackThemeBundle(__name__,
                           'assets',
                           default='semantic-ui',
                           themes={
                               'semantic-ui':
                               dict(
                                   entry={
                                       'cernopendata_css':
                                       './scss/styles.scss',
                                       'cernopendata_js': './js/app.js'
                                   },
                                   dependencies={
                                       'open-iconic': '~1.1.1',
                                       'popper.js': '~1.11.0',
                                   },
                                   aliases={
                                       '../../theme.config$':
                                       'less/cernopendata/theme.config',
                                   },
                               ),
                           })

glossary = WebpackThemeBundle(__name__,
                              'assets',
                              default='semantic-ui',
                              themes={
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 TUGRAZ.
#
# invenio-theme-tugraz  is free software.
"""JS/CSS Webpack bundles for theme."""

from invenio_assets.webpack import WebpackThemeBundle

theme = WebpackThemeBundle(
    __name__,
    "assets",
    default="semantic-ui",
    themes={
        "semantic-ui":
        dict(
            entry={
                "invenio-theme-tugraz-theme":
                "./less/invenio_theme_tugraz/theme.less",
                "invenio-theme-tugraz-js":
                "./js/invenio_theme_tugraz/theme.js",
                "invenio-theme-tugraz-search-app":
                "./js/invenio_theme_tugraz/search/index.js",
            },
            dependencies={},
        )
    },
)
"""JS/CSS Webpack bundles for theme."""

from invenio_assets.webpack import WebpackThemeBundle

theme = WebpackThemeBundle(
    __name__,
    'assets',
    default='semantic-ui',
    themes={
        'bootstrap3': dict(
            entry={
                '{{ cookiecutter.project_shortname }}-theme': './scss/{{ cookiecutter.package_name }}/theme.scss',
                '{{ cookiecutter.project_shortname }}-preview': './js/{{ cookiecutter.package_name }}/previewer.js',
            },
            dependencies={},
            aliases={},
        ),
        'semantic-ui': dict(
            entry={
                '{{ cookiecutter.project_shortname }}-preview': './js/{{ cookiecutter.package_name }}/previewer.js',
            },
            dependencies={
                # add any additional npm dependencies here...
            },
            aliases={
                '../../theme.config$': 'less/{{ cookiecutter.package_name }}/theme.config',
            },
        ),
    }
)
Exemple #18
0
#
# geo-knowledge-hub is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""GEO Knowledge Hub Front (page) webpack."""

from invenio_assets.webpack import WebpackThemeBundle

theme = WebpackThemeBundle(
    __name__,
    "theme/assets",
    default="semantic-ui",
    themes={
        "semantic-ui":
        dict(
            entry={
                "geo-knowledge-hub-front-carousel":
                "./js/geo_knowledge_hub_front/front/index.js",
                "geo-knowledge-hub-front-carousel-theme":
                "./less/geo_knowledge_hub_front/front/theme.less",
                "geo-knowledge-hub-front-overview-theme":
                "./less/geo_knowledge_hub_front/overview/theme.less",
            },
            dependencies={
                "react-glider": "^3.0.1",
                "natsort": "^2.0.3"
            },
        )
    },
)
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 TUGRAZ.
#
# invenio-theme-tugraz  is free software.
"""JS/CSS Webpack bundles for theme."""

from invenio_assets.webpack import WebpackThemeBundle

theme = WebpackThemeBundle(__name__,
                           'assets',
                           default='semantic-ui',
                           themes={
                               'semantic-ui':
                               dict(entry={
                                   'invenio-theme-tugraz-theme':
                                   './less/invenio_theme_tugraz/theme.less',
                                   'invenio-theme-tugraz-js':
                                   './js/invenio_theme_tugraz/theme.js'
                               },
                                    dependencies={})
                           })
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 TUGRAZ.
#
# invenio-theme-tugraz  is free software.
"""JS/CSS Webpack bundles for theme."""

from invenio_assets.webpack import WebpackThemeBundle

theme = WebpackThemeBundle(
    __name__,
    "assets",
    default="semantic-ui",
    themes={
        "semantic-ui":
        dict(
            entry={
                "invenio-theme-tugraz-theme":
                "./less/invenio_theme_tugraz/theme.less",
                "invenio-theme-tugraz-js":
                "./js/invenio_theme_tugraz/theme.js",
            },
            dependencies={
                # add any additional npm dependencies here...
            },
        )
    },
)
Exemple #21
0
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
# Copyright (C) 2020 Northwestern University.
#
# Invenio RDM Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.

"""JS/CSS Webpack bundles for theme."""

from invenio_assets.webpack import WebpackThemeBundle

theme = WebpackThemeBundle(
    __name__,
    'assets',
    default='semantic-ui',
    themes={
        'semantic-ui': dict(
            entry={
                'invenio-rdm-records-theme':
                    './less/invenio_rdm_records/theme.less',
                'invenio-rdm-records-js':
                    './js/invenio_rdm_records/rdmrecords.js',
            },
            dependencies={}
        )
    }
)
Exemple #22
0
from invenio_assets.webpack import WebpackThemeBundle

theme = WebpackThemeBundle(
    __name__,
    'assets',
    default='semantic-ui',
    themes={
        'bootstrap3':
        dict(
            entry={
                'iroko-theme': './scss/iroko/theme.scss',
                'iroko-preview': './js/iroko/previewer.js',
            },
            dependencies={},
            aliases={},
        ),
        'semantic-ui':
        dict(
            entry={
                'iroko-preview': './js/iroko/previewer.js',
            },
            dependencies={
                # add any additional npm dependencies here...
            },
            aliases={
                '../../theme.config$': 'less/iroko/theme.config',
            },
        ),
    })
Exemple #23
0
theme = WebpackThemeBundle(
    __name__,
    "assets",
    default="semantic-ui",
    themes={
        "semantic-ui":
        dict(
            entry={
                "invenio-theme-tugraz-theme":
                "./less/invenio_theme_tugraz/theme.less",
                "invenio-theme-tugraz-js":
                "./js/invenio_theme_tugraz/theme.js",
                # overrides RDM deposit form
                'invenio-theme-tugraz-rdm-deposit':
                './js/invenio_theme_tugraz/deposit/index.js',
            },
            dependencies={
                # add any additional npm dependencies here...
                # Keep these dep: in sync with releases
                "@babel/runtime": "^7.9.0",
                'formik': '^2.1.4',
                'luxon': '^1.23.0',
                'path': '^0.12.7',
                'prop-types': '^15.7.2',
                'react-dnd': '^11.1.3',
                'react-dnd-html5-backend': '^11.1.3',
                'react-invenio-deposit': '^0.13.5',
                'react-invenio-forms': '^0.7.0',
                'react-dropzone': "^11.0.3",
                'yup': '^0.27.0',
                '@ckeditor/ckeditor5-build-classic': '^16.0.0',
                '@ckeditor/ckeditor5-react': '^2.1.0',
            },
        )
    },
)
{% include 'misc/header.py' %}
"""JS/CSS Webpack bundle to override search results template."""

from invenio_assets.webpack import WebpackThemeBundle

search_app = WebpackThemeBundle(
    __name__,
    'assets',
    default='semantic-ui',
    themes={
        'bootstrap3': dict(entry={}, dependencies={}, aliases={}),
        'semantic-ui': dict(
            entry={
                '{{ cookiecutter.project_shortname }}-search-app':
                './js/{{ cookiecutter.package_name }}_records/index.js',
            },
            dependencies={
                "react": "^16.9.0",
                "react-dom": "^16.9.0",
                "react-overridable": "^0.0.2",
                "semantic-ui-react": "^0.88.0"
            }
        )
    }
)
Exemple #25
0
previewer = WebpackThemeBundle(
    __name__,
    'assets',
    default='semantic-ui',
    themes={
        'bootstrap3':
        dict(entry={
            'd3_csv': './js/invenio_previewer/csv_previewer/init.js',
            'previewer_theme': './js/invenio_previewer/previewer_theme.js',
            'fullscreen_js': './js/invenio_previewer/fullscreen.js',
            'prism_js': './js/invenio_previewer/prismjs.js',
            'prism_css': './scss/invenio_previewer/prismjs.scss',
            'pdfjs_js': './js/invenio_previewer/pdfjs.js',
            'pdfjs_css': './scss/invenio_previewer/pdfjs.scss',
            'simple_image_css': './scss/invenio_previewer/simple_image.scss',
        },
             dependencies={
                 'bootstrap-sass': '~3.4.0',
                 'd3': '^3.5.17',
                 'flightjs': '~1.5.1',
                 'font-awesome': '~4.5.0',
                 'jquery': '^3.3.1',
                 'pdfjs-dist': '^1.4.192',
                 'prismjs': '^1.15.0',
             },
             aliases={
                 '@scss/invenio_previewer': 'scss/invenio_previewer',
             }),
        'semantic-ui':
        dict(entry={
            'd3_csv': './js/invenio_previewer/csv_previewer/init.js',
            'previewer_theme': './js/invenio_previewer/previewer_theme.js',
            'fullscreen_js': './js/invenio_previewer/fullscreen.js',
            'prism_js': './js/invenio_previewer/prismjs.js',
            'prism_css': './scss/invenio_previewer/prismjs.scss',
            'pdfjs_js': './js/invenio_previewer/pdfjs.js',
            'bottom_js': './js/invenio_previewer/bottom.js',
            'pdfjs_css': './scss/invenio_previewer/pdfjs.scss',
            'zip_css': './scss/invenio_previewer/zip.scss',
            'bottom_css': './scss/invenio_previewer/bottom.scss',
            'simple_image_css': './scss/invenio_previewer/simple_image.scss',
        },
             dependencies={
                 'd3': '^3.5.17',
                 'flightjs': '~1.5.1',
                 'font-awesome': '~4.5.0',
                 'jquery': '^3.3.1',
                 'pdfjs-dist': '^1.4.192',
                 'prismjs': '^1.15.0',
             }),
    })
theme = WebpackThemeBundle(
    __name__,
    'assets',
    default='semantic-ui',
    themes={
        'semantic-ui':
        dict(
            entry={
                'invenio-app-rdm-records':
                './js/invenio_app_rdm/landing_page/index.js',
                'invenio-app-rdm-record-management':
                './js/invenio_app_rdm/landing_page/recordManagement.js',
                'invenio-app-rdm-deposits-deposit-form-js':
                './js/invenio_app_rdm/deposits/RDMDepositForm/index.js',
                'rdm_search_app':
                './js/invenio_app_rdm/search/index.js',
                'rdm_deposits_search_app':
                './js/invenio_app_rdm/deposits/search/index.js',
            },
            dependencies={
                # add any additional npm dependencies here...
                "@babel/runtime": "^7.9.0",
                'formik': '^2.1.4',
                'luxon': '^1.23.0',
                'path': '^0.12.7',
                'prop-types': '^15.7.2',
                'react-invenio-deposit': '^0.9.8',
                'react-invenio-forms': '^0.4.0',
                'react-dropzone': "^11.0.3",
                '@ckeditor/ckeditor5-build-classic': '^16.0.0',
                '@ckeditor/ckeditor5-react': '^2.1.0',
            },
            aliases={
                # Define Semantic-UI theme configuration needed by
                # Invenio-Theme in order to build Semantic UI (in theme.js
                # entry point). theme.config itself is provided by
                # cookiecutter-invenio-rdm.
                '../../theme.config$': 'less/theme.config',
            }),
    })
Exemple #27
0
theme = WebpackThemeBundle(
    __name__,
    'assets',
    default='semantic-ui',
    themes={
        'semantic-ui':
        dict(
            entry={
                'invenio-app-rdm-deposits-deposit-form-js':
                './js/invenio_app_rdm/deposits/RDMDepositForm/index.js',
                'invenio-app-rdm-search-app-js':
                './js/invenio_app_rdm/search_app_customizations.js',
            },
            dependencies={
                # add any additional npm dependencies here...
                "@babel/runtime": "^7.9.0",
                'formik': '^2.1.4',
                'luxon': '^1.23.0',
                'path': '^0.12.7',
                'prop-types': '^15.7.2',
                'react-invenio-deposit': '^0.4.0',
                'react-invenio-forms': '^0.3.0',
            },
            aliases={
                # Define Semantic-UI theme configuration needed by
                # Invenio-Theme in order to build Semantic UI (in theme.js
                # entry point). theme.config itself is provided by
                # cookiecutter-invenio-rdm.
                '../../theme.config$': 'less/theme.config',
            }),
    })
Exemple #28
0
theme = WebpackThemeBundle(
    __name__,
    'assets',
    default='bootstrap3',
    themes={
        'bootstrap3': dict(
            entry={
                'base': './js/invenio_theme/base.js',
                # requires jquery, moment, select2, bootstrap
                'adminlte': './js/invenio_theme/admin.js',
                'theme-admin': './scss/invenio_theme/admin.scss',
                'theme': './scss/invenio_theme/theme.scss',
            },
            dependencies={
                'bootstrap-sass': '~3.3.5',
                'font-awesome': '~4.4.0',
                'jquery': '~3.2.1',
                'moment': '~2.23.0',
                'select2': '~4.0.2',
                'admin-lte': '~2.4.8',
            }
        ),
        'semantic-ui': dict(
            entry={
                'base': './js/invenio_theme/base.js',
                # theme.js is the main file for the Semantic-UI theme.
                # - theme.js imports semantic-ui-less/semantic.less
                # - semantic-ui-less/semantic.less imports various files
                #   that all import "../../theme.config".
                # - theme.config (must be provided by an Invenio instance, that
                #   sets this as an alias) imports semantic-ui-less/theme.less.
                # - semantic-ui-less/theme.less imports
                #   1) the theme package: an invenio theme is configured below
                #      via the "themes/invenio" alias). theme.config set the
                #      respective variables to the "invenio" theme (e.g.
                #      "@site: 'invenio';").
                #   2) site theme: defined via the @siteFolder variable in
                #      "theme.config".
                'theme-admin': './scss/invenio_theme/admin.scss',
                'adminlte': './js/invenio_theme/admin.js',
                'theme': './js/invenio_theme/theme.js',
            },
            dependencies={
                'semantic-ui-less': '~2.4.1',
                'semantic-ui-css': '~2.4.1',
                'font-awesome': '~4.4.0',
                'jquery': '~3.2.1',
                'select2': '~4.0.2',
                'admin-lte': '~2.4.8',
            },
            aliases={
                '@js/invenio_theme': 'js/invenio_theme',
                '@less/invenio_theme': 'less/invenio_theme',
                # Used for defining an 'invenio' theme for Semantic-UI. The
                # code in "Semantic-UI-Less/theme.less" will look for e.g.
                # themes/@{theme}/globals/site.variables". This will resolve
                # to the path "less/invenio_theme/theme/global/site.variables".
                # This means that you in "theme.config" can use "invenio" as a
                # theme, e.g.:
                #   @site: 'invenio';
                'themes/invenio': 'less/invenio_theme/theme',
                # The @templates alias is used for overwriting JSX templates.
                # The alias assumes that a folder "templates" exists in the
                # root of the var/instance/assets (root of webpack project).
                # Cookiecutter-Invenio-Instance and Invenio-CLI is currently
                # responsible for creating this folder. The build will fail
                # if this folder is not created.
                '@templates': 'templates',
            }
        ),
    }
)
Exemple #29
0
communities = WebpackThemeBundle(
    __name__,
    'assets',
    default='semantic-ui',
    themes={
        'semantic-ui': dict(
            entry={
                'invenio-communities-theme':
                    './less/invenio_communities/theme.less',
                'invenio-communities-new':
                    './js/invenio_communities/new.js',
                'invenio-communities-privileges':
                    './js/invenio_communities/settings/privileges.js',
                'invenio-communities-profile':
                    './js/invenio_communities/settings/profile/index.js',
                'invenio-communities-frontpage':
                    './js/invenio_communities/frontpage.js',
                # 'invenio-communities-members':
                #     './js/invenio_communities/members.js',
                # 'invenio-communities-request':
                #     './js/invenio_communities/request.js',
                # 'invenio-communities-records':
                #     './js/invenio_communities/records.js',
                'invenio-communities-search':
                    './js/invenio_communities/search.js',
                # 'invenio-communities-records-search':
                #     './js/invenio_communities/records_search.js',
                # 'invenio-communities-records-curate':
                #     './js/invenio_communities/curate.js',
                # 'invenio-communities-collections-settings':
                #     './js/invenio_communities/collections/settings.js',
            },
            dependencies={
                'semantic-ui-css': '^2.4.1',
                'semantic-ui-react': '^0.88.2',
                '@ckeditor/ckeditor5-build-classic': '^16.0.0',
                '@ckeditor/ckeditor5-react': '^2.1.0',
                'axios': '^0.19.0',
                'formik': '^2.0.6',
                'lodash': '^4.17.15',
                'luxon': '^1.21.1',
                'path': '^0.12.7',
                'prop-types': '^15.7.2',
                'qs': '^6.9.1',
                'react': '^16.12.0',
                'react-dom': '^16.11.0',
                'react-redux': '^7.1.3',
                'react-searchkit': '^0.15.0',
                'redux': '^4.0.5',
                'redux-thunk': '^2.3.0',
                'yup': '^0.27.0',
            }
        ),
    }
)
Exemple #30
0
theme = WebpackThemeBundle(
    import_name=__name__,
    folder="theme/assets",
    default="semantic-ui",
    themes={
        "semantic-ui":
        dict(
            entry={
                # User Stories
                "geo-knowledge-hub-landing-user-stories":
                "./js/geo_knowledge_hub_detail/user_stories/index.js",
                # Engagement carousel
                "geo-knowledge-hub-landing-engagements-carousel":
                "./js/geo_knowledge_hub_detail/engagements_carousel_sidebar/index.js",
                "geo-knowledge-hub-landing-engagements-carousel-theme":
                "./less/geo_knowledge_hub_detail/engagements_carousel_sidebar/theme.less",
                # Geospatial metadata visualizer
                "geo-knowledge-hub-landing-geospatial-metadata-visualizer":
                "./js/geo_knowledge_hub_detail/geospatial_previewer/index.js",
                "geo-knowledge-hub-landing-geospatial-metadata-visualizer-theme":
                "./less/geo_knowledge_hub_detail/geospatial_previewer/theme.less",
            },
            dependencies={
                "leaflet": "^1.7.1",
                "react-leaflet": "3.1.0",
                "@react-leaflet/core": "1.0.2",
                "natsort": "^2.0.3",
                "lodash": "^4.17.0",
                "react-glider": "^3.0.1",
                "pure-react-carousel": "^1.28.1",
            },
        )
    },
)